Search code examples
ioscordovaurbanairship.com

How to identify the status of Push notification is 'Dont Allow' or 'Ok' in Urban Airship cordova?


I am doing cordova project using UrbanAirship push notification. When we are launching the app we will get the Push notification alert message in our app like “Don’t allow’” and ‘allow’ options. If user click on the ‘don’t allow’ option in my app I have to make the toggle to ‘off’, but how to identify that the user clicked on the don’t allow or ok. Can anyone please help to find the status or any other approach to resolve it? Thank in advance.


Solution

  • You can get the status by calling isAppNotificationsEnabled. I believe the system prompt will cause the cordova app to be paused, so on resume you should be able to query it with the updated value. There is not currently no event available for this field changing, but we can add one in a future release.