-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 8 : app crashes during SMS sending #147
Comments
hey @oleg531, can you please check the logcat logs? you probably can find a stacktrace there. |
@dbaq , Thanks for reply!
|
Thanks for the stacktrace. It looks like the a permission issue: In your config.xml, do you have |
No, I haven't. Possible it could help, I found it on official Android 8 behavior changes:
Have you any idea about it? |
I solved my problem. By Ionic 3, I explicitly granted permissions READ_PHONE_STATE (using official documentation) . Anyway, it looks like, since Android 8 cordova-SMS-plugin begin required READ_PHONE_STATE permission. I do not know is it a bug or not, because I do not have a rich experience in writing android app. @dbaq Thank you for helping and giving me the right direction! |
I have the same problem. But I don't think that :
is the case. It throws error so its exactly where sendTextMessage is called. And sendTextMessage shouldn't need any additional permissions beside SEND_SMS |
@vegetablesalad So, you mean it is a bug in cordova-sms-plugin? Or it is just relate only to my case and some permissions on my own phone after Android 8 upgrading? |
@oleg531 Here is stack overflow post, please up vote. |
I am confused, the |
@dbaq android uses permission from manifest only below version 5.1.1. Above this version you have to get permission at runtime. Anyway that is not the issue. Issue is that according to documentation we shouldn't need |
Hi, Anybody got an update on this issue? Anyone tried fixing it using the suggestion by @oleg531 ? |
@lijithwv you can follow this issue at stack overflow. There you can also find link to google issue tracker. Basically short story is that android 8.0 has bug with sendTextMessage, it asks for READ_PHONE_STATE permission. You have only two options - ask for extra permission or don't use it. It is reportedly fixed in android 8.1, but i can't confirm it. Google has no official response on this and is continuing as if nothing happened. I just removed SMS sending from my application, not to fall for this in future releases. |
I'm seeing the issue of the app crashing when sending an SMS on a Motorola Moto G5, Android 7.0 -- the javascript console shows no errors with the device hooked up to Chrome://inspect, in debug mode. My workaround (not a proper solution) for the moment is to use an "intent" with the value of "INTENT", rather than empty, "". This means that instead of the app instantly sending the pre-prepared SMS text, it will open the phone's native SMS dialog, where the user can edit the SMS before sending (or not sending) it. Ultimately this is not what I want, I much prefer the option of intent == "" to work, whereby the SMS is sent immediately, but on my Motorola Android 7.0 it crashes the app. I'm using pure command-line cordova, not Ionic or PhoneGap. |
I have the same issue, app crash on Android 8. In previous versions works fine. |
just tested on Android 8.0 and plugin 0.1.13 . It crash. Problem it's on permission READ_PHONE_STATE. You can ask confirm permission from plugin like already happens with permission SEND_SMS ? |
I'd say that because it is a specific issue to android 8.0 only. It is not necessary for me to update the plugin to add extra methods. If you are facing this issue, you can request the If the community wants me to add the READ_PHONE_STATE permission request in this plugin, please let me know by commenting below. |
Perhaps that could be the correct path, it doesn't look that google will push a update to fix this issue. But it should ask permission only for android 8. |
For me, I forgot to use INTENT (native android messaging, which is what I wanted).
|
This now crashes on Android 7, 8 and 9 for us. Is there any more information on why this is happening? Cheers, Ed |
@mredbishop with the exact same error? I haven't noticed that this issue persists in other Android versions. I have moved away from sending sms from app, so I'v been out of the loop. |
@vegetablesalad Not 100% on Android 7 as that was reported by a third party but Android 8, 8.1 and 9 we tested and reproduced this. I forked the repository yesterday (Friday 2nd Nov) and fixed it by requesting the required READ_PHONE_STATE permission on top of the original SMS_SEND permission. It's all working for us now, and in fact we shipped an update to our product with it in yesterday and our users are reporting it resolved. |
@mredbishop I hope you did that only for affected android versions. |
@mredbishop do you mind opening a pull request? that would be really great. Thanks. |
@vegetablesalad that would be rather difficult as I don't know what versions of Android it affects other than the ones I've tested and had reports from. It happens on every version of Android we've tested here. @dbaq I could, but as vegetablesalad points out this probably isn't required for all versions of Android so there is probably a more elegant solution to the problem. I would say for most people it would be very simple, as you pointed out, to use the cordova-plugin-android-permissions. |
Related to #183 somehow. Please read this one as well. |
Hello!
Recently I updated my Nexus 5x to Android 8.
I am using Ionic 3 (which use under the hood the cordova-sms-plugin) for development
After that, sending SMS starts to cause the app crash (before updating SMS works fine).
Could anyone know what's the reason?
Thanks!
The text was updated successfully, but these errors were encountered: