File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Example/android/app/src/main Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1212 <uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
1313 <uses-permission android : name =" android.permission.READ_CONTACTS" />
1414 <uses-permission android : name =" android.permission.READ_CALENDAR" />
15-
15+ <uses-permission android : name =" android.permission.READ_SMS" />
16+ <uses-permission android : name =" android.permission.RECEIVE_SMS" />
1617
1718 <application
1819 android : name =" .MainApplication"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ The current supported permissions are:
1313- Push Notifications * (iOS only)*
1414- Background Refresh * (iOS only)*
1515- Speech Recognition * (iOS only)*
16+ - Read/Receive SMS * (Android only)*
1617
1718
1819| Version | React Native Support |
@@ -120,6 +121,8 @@ Promises resolve into one of these statuses
120121| ` backgroundRefresh ` | ✔️ | ❌ |
121122| ` speechRecognition ` | ✔️ | ❌ |
122123| ` storage ` | ❌️ | ✔ |
124+ | ` readSms ` | ❌️ | ✔ |
125+ | ` receiveSms ` | ❌️ | ✔ |
123126
124127### Methods
125128| Method Name | Arguments | Notes
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ const RNPTypes = {
1212 event : RNPermissions . PERMISSIONS . READ_CALENDAR ,
1313 storage : RNPermissions . PERMISSIONS . READ_EXTERNAL_STORAGE ,
1414 photo : RNPermissions . PERMISSIONS . READ_EXTERNAL_STORAGE ,
15+ readSms : RNPermissions . PERMISSIONS . READ_SMS ,
16+ receiveSms : RNPermissions . PERMISSIONS . READ_SMS ,
1517}
1618
1719const RESULTS = {
@@ -41,7 +43,7 @@ class ReactNativePermissions {
4143 check ( permission ) {
4244 const androidPermission = RNPTypes [ permission ]
4345 if ( ! androidPermission ) return Promise . reject ( `ReactNativePermissions: ${ permission } is not a valid permission type on Android` ) ;
44-
46+
4547 const shouldShowRationale = ReactNative . NativeModules . PermissionsAndroid . shouldShowRequestPermissionRationale ;
4648
4749 return RNPermissions . check ( androidPermission )
You can’t perform that action at this time.
0 commit comments