pbakondy / cordova-plugin-sim

:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
MIT License
163 stars 101 forks source link

permissions for android 10+, default subscription id, refactor #96

Open bartguz opened 2 years ago

bartguz commented 2 years ago

based on kitrio branch, fix for permission issues on android 10+.

READ_PHONE_STATE is not enough to access full data, additional READ_PHONE_NUMBERS is required. Permissions got refactored into array, which should allow for easier modifications.

I've refactored code a bit - created grouping methods that may slightly better describe what is where accessed, and reduced nesting here and there.

alborrajo's default subscription id is included, but on condition getActiveSubscriptionInfoList returns non-empy list. I've included this change here, because my PR changes code a bit and merging would be tricky