---
title: iOS Permissions
description: >-
  iOS notification permissions with react-native-permissions:
  requestNotifications(), checkNotifications(), permission options, provisional
  authorization, and the in-app notification settings button.
next: /messaging/notifications
previous: /messaging/usage/ios-setup
---
> ## Documentation Index
> Fetch the complete documentation index at: https://rnfirebase.io/llms.txt
> Use this file to discover all available pages before exploring further.

## Prerequisites

- `@react-native-firebase/app` and `@react-native-firebase/messaging` installed (`npm install --save @react-native-firebase/app @react-native-firebase/messaging` or `yarn add @react-native-firebase/app @react-native-firebase/messaging`), then `cd ios && pod install`.
- Native Firebase config and [iOS Messaging Setup](/messaging/usage/ios-setup) completed (Push Notifications, Background Modes, APNs). From v26, New Architecture is required for packages with a native bridge.
- [react-native-permissions](https://github.com/zoontek/react-native-permissions) installed and set up for iOS notifications (see its setup guide).

## Understanding permissions

Before diving into requesting notification permissions from your users, it is important to understand how iOS handles permissions.

Notifications cannot be shown to users if the user has not "granted" your application permission. The overall notification permission of a single application can be either be "not determined", "granted" or "declined". Upon installing an application, the default status is "not determined".

In order to receive a "granted" status, you must request permission from your user (see below). The user can either accept or decline your request to grant permissions. If granted, notifications will be displayed based on the permission settings which were requested.

If the user declines the request, you cannot re-request permission, trying to request permission again will immediately return a "blocked" status without any user interaction - instead the user must manually enable notification permissions from the iOS Settings UI.

## Requesting permissions

Permission must be requested from your users in order to display remote notifications from FCM. Use `requestNotifications` from `react-native-permissions`:

```js
// codeblock-ignore: imports react-native-permissions, a third-party package that is not a dependency of React Native Firebase
import { requestNotifications } from 'react-native-permissions';

async function requestUserPermission() {
  const { status } = await requestNotifications(['alert', 'badge', 'sound']);

  console.log('Permission status:', status);
}

await requestUserPermission();
```

On iOS the result `status` is one of `granted`, `denied` (not requested yet), `blocked` (declined, so the user must change it in Settings) or `unavailable`. On Android 13 and above, `requestNotifications` requests the `POST_NOTIFICATIONS` permission for you.

Once a user has selected a permission status, iOS prevents the permission dialog from being displayed again. This allows the users of your application full control of how notifications are handled:

- If the user declines permission, they must manually allow notifications via the Settings UI for your application.
- If the user has accepted permission, notifications will be shown using the settings requested (e.g. with or without sound).

### Permission settings

Although overall notification permission can be granted, the permissions can be further broken down into settings.

Settings are used by the device to control notifications behavior, for example alerting the user with sound. When requesting permission, you pass the list of options you want. Omit an option to leave it out of the request. This is demonstrated in the following example:

```js
// codeblock-ignore: imports react-native-permissions, a third-party package that is not a dependency of React Native Firebase
import { requestNotifications } from 'react-native-permissions';

await requestNotifications(['alert', 'badge', 'carPlay']);
```

The options `requestNotifications` accepts on iOS:

{/* prettier-ignore */}
| Option | Description |
| --- | --- |
| `alert` | Sets whether notifications can be displayed to the user on the device. |
| `badge` | Sets whether a notification dot will appear next to the app icon on the device when there are unread notifications. |
| `carPlay` | Sets whether notifications will appear when the device is connected to [CarPlay](https://www.apple.com/ios/carplay/). |
| `criticalAlert` | Requests the critical alerts authorization, which lets notifications play a sound even when the device is muted or Do Not Disturb is on. Apple requires an entitlement for it. |
| `provisional` | Sets whether provisional permissions are granted. See [Provisional authorization](/messaging/ios-permissions#provisional-authorization) for more information. |
| `sound` | Sets whether a sound will be played when a notification is displayed on the device. |
| `providesAppSettings` | Indicates the system to display a button for in-app notification settings. |

The settings provided will be stored by the device and will be visible in the iOS Settings UI for your application.

If the permission dialog has already been presented to the user and you wish to update the existing permission settings
(e.g. enabling sound), the setting will be silently updated and the `requestNotifications` call will instantly resolve without showing a dialog.

#### Reading current status

In some cases, you may wish to read the current permission status without showing a dialog. Use `checkNotifications`:

```js
// codeblock-ignore: imports react-native-permissions, a third-party package that is not a dependency of React Native Firebase
import { checkNotifications } from 'react-native-permissions';

async function checkApplicationPermission() {
  const { status, settings } = await checkNotifications();

  if (status === 'granted') {
    console.log('User has notification permissions enabled.', settings);
  } else if (status === 'denied') {
    console.log('Notification permission has not been requested yet.');
  } else {
    console.log('User has notification permissions disabled');
  }
}

await checkApplicationPermission();
```

To help improve the chances of the user granting your app permission, it is recommended that permission is requested at a time which makes
sense during the flow of your application (e.g. starting a new chat), where the user would expect to receive such notifications.

### Provisional authorization

Devices on iOS 12+ can use provisional authorization. This type of permission system allows for notification
permission to be instantly granted without displaying a dialog to your user. The permission allows notifications to be displayed quietly, meaning they are only visible within the device notification center.

To enable provisional notifications, include `provisional` in the options passed to `requestNotifications`:

```js
// codeblock-ignore: imports react-native-permissions, a third-party package that is not a dependency of React Native Firebase
import { requestNotifications } from 'react-native-permissions';

await requestNotifications(['provisional']);
```

Users can then choose a permission option via the notification itself, and select whether they can continue to display quietly, display prominently or not at all.

### Handle button for in-app notifications settings

Devices on iOS 12+ can provide a button in iOS Notifications Settings _(at OS level: `Settings -> [App name] -> Notifications`)_ to redirect users to in-app notifications settings.

1. Request `providesAppSettings` permissions:

```js
// codeblock-ignore: imports react-native-permissions, a third-party package that is not a dependency of React Native Firebase
import { requestNotifications } from 'react-native-permissions';

await requestNotifications(['alert', 'providesAppSettings']);
```

2. Handle interaction when the app is in a background state. `setOpenSettingsForNotificationsHandler` and `getDidOpenSettingsForNotification` are iOS features: on Android the handler is never called and `getDidOpenSettingsForNotification` resolves `false`. Register the open-settings handler in the entry file **before** `AppRegistry.registerComponent` (same placement rule as `setBackgroundMessageHandler`):

```js
// index.js
import { AppRegistry } from 'react-native';
import {
  getMessaging,
  setOpenSettingsForNotificationsHandler,
} from '@react-native-firebase/messaging';

const messaging = getMessaging();

setOpenSettingsForNotificationsHandler(messaging, async () => {
  // Persist a flag your root component reads on mount (AsyncStorage, MMKV, etc.).
  console.log('User opened app notification settings from iOS Settings');
});

function App() {
  return null;
}

AppRegistry.registerComponent('app', () => App);
```

3. Handle interaction when the app is in a quit state with `getDidOpenSettingsForNotification`:

```jsx
import React, { useEffect } from 'react';
import { View, Text } from 'react-native';
import { getMessaging, getDidOpenSettingsForNotification } from '@react-native-firebase/messaging';

function App() {
  useEffect(() => {
    const messaging = getMessaging();
    getDidOpenSettingsForNotification(messaging).then(didOpenSettingsForNotification => {
      if (didOpenSettingsForNotification) {
        console.log('Opened from iOS notification settings (quit state)');
        // Navigate to your in-app notification settings screen.
      }
    });
  }, []);

  return (
    <View>
      <Text>App</Text>
    </View>
  );
}

export default App;
```
