I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.
4 Answers
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.

- 10,094
- 10
- 68
- 109
-
1but 'notification' permission using react-native-permission only works with ios and not with android. – mayank goyal Nov 19 '18 at 09:49
-
That is why added "another library". – rptwsthi Nov 19 '18 at 09:50
-
As of today, the "react-native-permissions" describes itself as "A unified permissions API for React Native on iOS, Android and Windows.", so maybe they updated it =) – Ted Jan 18 '23 at 11:52
Official way https://github.com/react-native-community/react-native-permissions#checknotifications
import {requestNotifications} from 'react-native-permissions';
requestNotifications(['alert', 'sound']).then(({status, settings}) => {
// …
});

- 8,493
- 2
- 47
- 52
Android:
Actually the Push Notification permission lie in Normal Category Permission like INTERNET permission not in Dangerous Category Permission.
You don't have to ask for Push Notification permissions.
More details is here, https://stackoverflow.com/a/37294287/7188778

- 31
- 1
- 5
-
This has changed since Android 13: https://source.android.com/docs/core/display/notification-perm – Ishita Sinha Apr 25 '23 at 10:24
You can use Notifee Library package to request for notification permission for both (ios and android) and also you can check the permission status but i don't think there is a package which states whether permission is switched off by user.

- 31
- 2