Eric Conner
Eric Conner

Reputation: 10772

How can I check if push notifications were disabled in React Native using PushNotificationIOS?

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.

Upvotes: 11

Views: 7482

Answers (1)

savelichalex
savelichalex

Reputation: 196

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.

Upvotes: 4

Related Questions