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
By default no permission handler is linked. To add one, update your `package.json` by adding the permissions used in your app, then run `npx react-native setup-ios-permissions` followed by `pod install` (`reactNativePermissionsIOS.json` is also supported).
30
-
31
-
_📌 Note that these commands must be re-executed each time you update this config, delete the `node_modules` directory or update this library. An useful trick to cover a lot of these cases is running them on `postinstall` and just run `yarn` or `npm install` manually when needed._
2. Then in the same file, add a `setup_permissions` call with the wanted permissions:
61
+
62
+
```ruby
63
+
# …
64
+
65
+
platform :ios, min_ios_version_supported
66
+
prepare_react_native_project!
67
+
68
+
# ⬇️ uncomment wanted permissions (don't forget to remove the last comma)
69
+
setup_permissions([
70
+
# 'AppTrackingTransparency',
71
+
# 'BluetoothPeripheral',
72
+
# 'Calendars',
73
+
# 'Camera',
74
+
# 'Contacts',
75
+
# 'FaceID',
76
+
# 'LocationAccuracy',
77
+
# 'LocationAlways',
78
+
# 'LocationWhenInUse',
79
+
# 'MediaLibrary',
80
+
# 'Microphone',
81
+
# 'Motion',
82
+
# 'Notifications',
83
+
# 'PhotoLibrary',
84
+
# 'PhotoLibraryAddOnly',
85
+
# 'Reminders',
86
+
# 'SpeechRecognition',
87
+
# 'StoreKit'
88
+
])
89
+
90
+
# …
91
+
```
92
+
93
+
3. Then execute `pod install`_(📌 Note that it must be re-executed each time you update this config)_.
94
+
4. Finally, update your `Info.plist` with the wanted permissions usage descriptions:
66
95
67
96
```xml
68
97
<?xml version="1.0" encoding="UTF-8"?>
@@ -181,7 +210,7 @@ Open the project solution file from the `windows` folder. In the app project ope
181
210
182
211
## 🆘 Manual linking
183
212
184
-
Because this package targets React Native 0.63.0+, you probably won't need to link it manually. Otherwise if it's not the case, follow these additional instructions. You also need to manual link the module on Windows when using React Native Windows prior to 0.63:
213
+
Because this package targets recent React Native versions, you probably don't need to link it manually. But if you have a special case, follow these additional instructions:
185
214
186
215
<details>
187
216
<summary><b>👀 See manual linking instructions</b></summary>
Note that the `rationale`parameter is only available and used on Android.
739
+
The `rationale` is only available and used on Android. It can be a native alert (a `Rationale` object) or a custom implementation (that resolves with a `boolean`).
711
740
712
741
```ts
713
742
typeRationale= {
@@ -718,7 +747,10 @@ type Rationale = {
718
747
buttonNeutral?:string;
719
748
};
720
749
721
-
function request(permission:string, rationale?:Rationale):Promise<PermissionStatus>;
0 commit comments