Cordova Android app crashes on Android P due to RECEIVE_SMS permission denial

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 05:30:11

问题


I have a Cordova Android app which works fine on earlier versions of Android OS, but app starts to crash on Android P (9.0), and I am getting the following logs while app launches:

Permission Denial: receiving Intent { act=android.provider.Telephony.SMS_RECEIVED flg=0x19000010 (has extras) } to com.example.myapp requires android.permission.RECEIVE_SMS due to sender com.android.phone    

My app is retrieving SMS for OTP autocomplete and i already added RECEIVE_SMS permission to config file.

It seems we have to migrate to the SMS Retrieval API which is described in this article, but in this case we need a cordova plugin to do so.

I will appreciate if anyone can guide how to fix this issue.


回答1:


Try using this cordova plugin - https://github.com/diegosiao/cordova-plugin-android-sms-retriever This might solve your issue.




回答2:


You can use below cordova plugin for permission.

https://www.npmjs.com/package/cordova-plugin-android-permissions



来源:https://stackoverflow.com/questions/54235794/cordova-android-app-crashes-on-android-p-due-to-receive-sms-permission-denial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!