Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

registration callback firing too soon on iOS? #2004

Closed
jespertheend opened this issue Oct 11, 2017 · 3 comments
Closed

registration callback firing too soon on iOS? #2004

jespertheend opened this issue Oct 11, 2017 · 3 comments

Comments

@jespertheend
Copy link

I'm trying to show a dialog to the user when they don't accept the notifications permission, however the .on("registration") callback is firing even before the user presses one of the two buttons in the dialog. Is there any way to fire a callback when the user presses either of these buttons?

I guess just polling PushNotification.hasPermission() is an option but I'd have to show the dialog even before the user has dismissed the native iOS dialog, and I'd rather only show it after the native iOS dialog is gone.

Is there any way to achieve this functionality?

@fredgalvao
Copy link
Collaborator

I'm 98.75% sure this is a duplicate of #1438, so I'll close this one. If I'm wrong, feel free to say so and elaborate on the difference.

@jespertheend
Copy link
Author

Thanks, I'd been looking for a duplicate but 2003 issues is a lot to go through hahah.
I think this one is pretty similar except the register event is only called once for me, not twice. It's just firing before the user has had a chance to accept the permissions. So when I call PushNotification.hasPermission() right after I get the registration event, it gives me {isEnabled: false}
Only after the user accepts it this value returns true, but I don't get a callback when that happens.

So it's a little different from #1438 but similar. I'm not sure if it's worth having it's own issue assigned.

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants