You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Native does not officially support api 23 currently ( it is on api 22 now. see: [RN known issues](https://facebook.github.io/react-native/docs/known-issues.html#android-m-permissions)) and android supports request permission at runtime since api 23, so it will always return 'granted' immediately after calling `checkRecordPermission()` or `requestRecordPermission()`.
176
+
177
+
If you really need the functionality, you can do the following to make them work but at your own risk:
178
+
( I've tested it though, but who knows :) )
179
+
180
+
Step 1: change your `targetSdkVersion` to 23 in `$your_project/android/app/build.gradle`
181
+
Step 2: override `onRequestPermissionsResult` in your `MainActivity.java` like:
182
+
183
+
```
184
+
@Override
185
+
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
If you change targetSdkVersion to 23, the `red box` which React Native used to display errors in development mode requires permission `Draw Over Other Apps`.
196
+
So in **development mode**, you should manually grant permission in `app settings` on your device or declare `android.permission.SYSTEM_ALERT_WINDOW` in your manifest.
197
+
You don't have to do this in **release mode** since there are no red box.
198
+
199
+
200
+
checkout this awesome project: [react-native-android-permissions](https://github.com/lucasferreira/react-native-android-permissions) by @lucasferreira for more information.
201
+
202
+
144
203
## Automatic Basic Behavior:
145
204
146
205
**on start:**
@@ -176,6 +235,8 @@ note: ios only supports `auto` currently.
176
235
| setSpeakerphoneOn(`enable: ?boolean`) |:smile:|:rage:| toggle speaker ON/OFF once. but not force</br>default: false |
177
236
| setForceSpeakerphoneOn(`flag: ?boolean`) |:smile:|:smile:| true -> force speaker on</br> false -> force speaker off</br> null -> use default behavior according to media type</br>default: null |
0 commit comments