由于拒绝RECEIVE_SMS权限,Cordova Android应用在Android P上崩溃 [英] Cordova Android app crashes on Android P due to RECEIVE_SMS permission denial
问题描述
我有一个Cordova Android应用程序,该应用程序在早期版本的Android OS上运行良好,但是该应用程序在Android P(9.0)上开始崩溃,并且在应用程序启动时收到以下日志:
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
我的应用正在检索OTP自动完成的SMS,并且我已经向配置文件添加了RECEIVE_SMS权限.
My app is retrieving SMS for OTP autocomplete and i already added RECEIVE_SMS permission to config file.
似乎我们必须迁移到 ,但在这种情况下,我们需要一个cordova插件来实现.
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.
推荐答案
尝试使用此cordova插件- https://github.com/diegosiao/cordova-plugin-android-sms-retriever 这可能会解决您的问题.
Try using this cordova plugin - https://github.com/diegosiao/cordova-plugin-android-sms-retriever This might solve your issue.
这篇关于由于拒绝RECEIVE_SMS权限,Cordova Android应用在Android P上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!