-
Notifications
You must be signed in to change notification settings - Fork 33
Know when the notification permission was accepted #32
Comments
Starting with iOS 8 they separated APNS registration (device token) with notificaiton permissions. Its actually entirely possible to message a device using APNS before the user accepts permissions if they have background notification capabilities enabled. The actual way to check for the permission is to check for the app delegate For Android, there is actually no permissions required to receive and post notifications :). The user can disable notifications in the application setting screen, which you can check with http://docs.urbanairship.com/reference/libraries/android/latest/reference/com/urbanairship/push/PushManager.html#isOptIn(). You can check if it changes whenever the app is resumed (they have to background the app to disable it). |
Great @rlepinski, thank you! :D |
So, @guilhermebruzzi, are you working on this? We'd need to have the |
…and explaining on README how to know on ios when the user accepted the notification. Update documentation
Hi @mkko, I've just sent a PR #33 |
…and explaining on README how to know on ios when the user accepted the notification. Update documentation
Hi @rlepinski ,
I will create a pull request on this project, that will enable the possibility to know on javascript when the user accepted the notification permission's dialog on iOS and Android 6+.
On iOS there is a didRegisterForRemoteNotificationsWithDeviceToken method that you can declare on AppDelegate.m and you will receive there if the user confirmed the notification permission's dialog.
On Android there is a onRequestPermissionsResult method of an Activity, that you can declare to know if a user confirmed a permission dialog that you called on a given Activity (https://developer.android.com/training/permissions/requesting.html#perm-check).
The problem is knowing how to get the permission's result on Android 6+, if is the Urban Airship SDK that controls this permission's request.
There is some sort of callback that Urban Airship Android's SDK give, that I can use to know if a user accepted the notification permission's dialog? Or any other way to know that?
Thank you in advance for your time! :D
The text was updated successfully, but these errors were encountered: