react-native-ua icon indicating copy to clipboard operation
react-native-ua copied to clipboard

Know when the notification permission was accepted

Open guilhermebruzzi opened this issue 8 years ago • 4 comments

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

guilhermebruzzi avatar Dec 06 '16 22:12 guilhermebruzzi