I'd like to determine if push notifications were disabled by a user using React Native with PushNotificationIOS.
PushNotificationIOS
has the method checkPermissions
, but this method only tells me whether notifications are enabled.
I would like, using React Native, to tell if my app prompted the user to enable notifications and the user denied the permission, or if the user independently went to settings and disabled notifications.
In native code, you'd use UNUserNotificationCenter
and check getNotificationSettings
for authorizationStatus
with value .denied
.
Thanks.
you need to check platform and do the configuration respectively. For Android to check notification status you need react-native-permissions library. import {checkNotifications} from 'react-native-permissions'; Depending on the notification you can enable and disable the button.
I can suggest to you try this library. This library have all features that you mention above. For me it's work great, hope for you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With