briankabiro / react-native-get-sms-android

React Native module to get messages on an Android device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

about `WRITE_SMS`

gamesover opened this issue · comments

commented

I am completely new to android, the permission is so complex to me :(

I follow the official docu, but sometimes, I can call code successfully, but sometimes, I cannot.

Eventually, I found the secret.

In manifest, you have to highlight write_sms for sure

<uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.WRITE_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />

But in PermissionsAndroid.requestMultiple, you cannot request PermissionsAndroid.PERMISSIONS.WRITE_SMS, android will throw error with null permission.

I hope it will help someone else