The documentation is currently a work in progress whilst the product is in alpha.

requestPermission

iOS Only

Request specific notification permissions for your application on the current device.



requestPermission(permissions?: IOSNotificationPermissions): Promise<IOSNotificationSettings>;

Both iOS & Android return an IOSNotificationSettings interface. To check whether overall permission was granted, check the authorizationStatus property in the response:

import notifee, { IOSAuthorizationStatus } from '@notifee/react-native';

const settings = await notifee.requestPermission(...);

if (settings.authorizationStatus === IOSAuthorizationStatus.DENIED) {
  console.log('User denied permissions request');
} else if (settings.authorizationStatus === IOSAuthorizationStatus.AUTHORIZED) {
   console.log('User granted permissions request');
} else if (settings.authorizationStatus === IOSAuthorizationStatus.PROVISIONAL) {
   console.log('User provisionally granted permissions request');
}

Use the other IOSNotificationSettings properties to view which specific permissions were allowed.

On Android, all of the properties on the IOSNotificationSettings interface response return as AUTHORIZED.


PropertyDescriptionOptional
permissions

Copyright 2020 © Invertase Limited

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License and code samples are licensed under the Apache 2.0 License.

All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.