react-native-sim-data
react-native-sim-data copied to clipboard
app forcefully closed with this error on os version < 21
app forcefully closed with this error on os version < 21
com.facebook.react.common.JavascriptException: C++ Exception in 'NativeModules': java.lang.NoSuchMethodError: android.telephony.TelephonyManager.getPhoneCount
react native - v44
although TelephonyManager
is available since API 1, that call doesn't exists in the current code. try doing a cd android && ./gradlew clean
and unlinking and re-linking the library
SubscriptionManager
on the other hand need at least API 22 level
Yes SubscriptionManager
needs API 22. so in that case, this module will not work in phones with API less than 22. or is there any workaround?
you can use TelephonyManager.getLine1Number
but the person needs to have set his own number on the phone in "phone identity" and most people don't
best (sure) way is to ask the person for his number then read from SMS