Giter VIP home page Giter VIP logo

Comments (7)

pbakondy avatar pbakondy commented on August 17, 2024

What do you mean "the plugin should not have READ_SMS permission dependency"?

from cordova-plugin-sim.

1N50MN14 avatar 1N50MN14 commented on August 17, 2024

@pbakondy My understanding is that READ_PHONE_STATE is the only permission required for the plugin to successfully work. For some reason the plugin throws READ_SMS permission error on Cordova 6.0.0 and Android 6.0.1. This was not the case when I ran the plugin with Cordova 5.4.0, I started seeing this error after upgrading.

from cordova-plugin-sim.

pbakondy avatar pbakondy commented on August 17, 2024

OK, I get it.
This error message can be misleading.

getLine1Number() method requires permission READ_PHONE_STATE or READ_SMS. The error message references only the second one.

http://developer.android.com/reference/android/telephony/TelephonyManager.html#getLine1Number%28%29

Please upgrade to the latest version of cordova-plugin-sim and test again.

from cordova-plugin-sim.

1N50MN14 avatar 1N50MN14 commented on August 17, 2024

Yup, thank you that did it! The one thing I noticed is the phoneNumber attribute is now missing in the callback object, I'm not sure if this is related to upgrading to Android 6.0.0, in which case isn't it supposed to be an empty string?

from cordova-plugin-sim.

pbakondy avatar pbakondy commented on August 17, 2024

https://github.com/pbakondy/cordova-plugin-sim#android-60-permissions

from cordova-plugin-sim.

1N50MN14 avatar 1N50MN14 commented on August 17, 2024

3,2,1 slap on my face! I'm usually careful going through README I should've revisited that. Closing issue, thanks for the help ;)

from cordova-plugin-sim.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

@pbakondy Just found this post by searching on the internet for this issue (not using the repo), and I'd like to correct you:
On Android 5.x and below, you must have READ_PHONE_STATE permission to call getLine1Number, but from Android 6.x it seems it needs either READ_PHONE_STATE or READ_SMS.
I suggest using only READ_PHONE_STATE, because I don't see any docs about this weird behavior.
Also, I've published a post about it here:
https://code.google.com/p/android/issues/detail?id=226748

from cordova-plugin-sim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.