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
Request notifications permission status and get notifications settings values.
772
772
773
-
You cannot request notifications permissions on Windows. Disabling or enabling notifications can only be done through the App Settings.
773
+
You cannot request notifications permissions on Windows. Disabling or enabling notifications can only be done through the App Settings.
774
774
You cannot request notifications permissions on Android. `requestNotifications` is the same than `checkNotifications` on this platform.
775
775
776
776
```ts
@@ -790,9 +790,7 @@ type NotificationSettings = {
790
790
notificationCenter?:boolean;
791
791
};
792
792
793
-
function requestNotifications(
794
-
options:NotificationOption[],
795
-
):Promise<{
793
+
function requestNotifications(options:NotificationOption[]):Promise<{
796
794
status:PermissionStatus;
797
795
settings:NotificationSettings;
798
796
}>;
@@ -932,20 +930,20 @@ If you are requesting `PERMISSIONS.IOS.LOCATION_ALWAYS`, there won't be a `Alway
932
930
933
931
When requesting `PERMISSIONS.IOS.LOCATION_ALWAYS`, if the user choose `Allow While Using App`, a provisional "always" status will be granted. The user will see `While Using` in the settings and later will be informed that your app is using the location in background. That looks like this:
Subsequently, if you are requesting `LOCATION_ALWAYS` permission, there is no need to request `LOCATION_WHEN_IN_USE`. If the user accepts, `LOCATION_WHEN_IN_USE` will be granted too. If the user denies, `LOCATION_WHEN_IN_USE` will be denied too.
935
+
Subsequently, if you are requesting `LOCATION_ALWAYS` permission, there is no need to request `LOCATION_WHEN_IN_USE`. If the user accepts, `LOCATION_WHEN_IN_USE` will be granted too. If the user denies, `LOCATION_WHEN_IN_USE` will be denied too.
938
936
939
937
### Testing with Jest
940
938
941
939
If you don't already have a Jest setup file configured, please add the following to your Jest configuration file and create the new `jest.setup.js` file in project root:
942
940
943
941
```js
944
-
setupFiles: ['<rootDir>/jest.setup.js']
942
+
setupFiles: ['<rootDir>/jest.setup.js'];
945
943
```
946
944
947
945
You can then add the following line to that setup file to mock the `NativeModule.RNPermissions`:
0 commit comments