Is it possible to develop a hybrid mobile app using Phonegap / Cordova and access the device phone number for both Android and iOS?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
iOS: You can retrieve the phone number using the CoreTelephony framework, you will need to add the following Entitlement:
com.apple.coretelephony.Identity.get
. However apple might reject your app once you upload it to the AppStore. However, if you plan to distribute using the "Enterprise Distribution" plan, you should have no problem at all, see answers by Igor Fedorchuk and Dylan here, and another elaborated answer here.Android: Yes, you could use this plugin, or write a cordova plugin that bridges the following code:
The required permission is
android.permission.READ_PHONE_STATE"
Android:I know i am late. After Searching a lot i found this plugin which works for me perfectly... add these plugin in your project
Put these code in your index.js here
But from That : Some vendors don't publish the phone number to the SIM card.