Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APNS Token Refresh Callback? #201

Closed
andysousa opened this issue Oct 29, 2019 · 2 comments
Closed

APNS Token Refresh Callback? #201

andysousa opened this issue Oct 29, 2019 · 2 comments
Labels
feature request New feature request ios relates to iOS platform

Comments

@andysousa
Copy link

Good day,

I am seeing a race condition of sorts. I am calling the grant permission and then immediately registering for the APNS token. As soon as that happens, the token is null. I then see this line a few seconds later

didRegisterForRemoteNotificationsWithDeviceToken: {length = 32, bytes = 0x5ea7634d abffead7 92515b06 e16f387d ... 604bbc82 xxxxxxxxx }

If I try to get APNS token again after that, no issue as I would expect. Is there a callback I can register for when the APNS token is ready? I tried this.firebase.onTokenRefresh() but that only seems to get called with the FCM token.

Any thought would be appreciated

@dpa99c
Copy link
Owner

dpa99c commented Oct 30, 2019

I've implemented a plugin API function for this on the dev branch.
This will be merged to master and pushed out in the next npm release.

@dpa99c dpa99c added feature request New feature request ios relates to iOS platform labels Oct 30, 2019
@andysousa
Copy link
Author

thanks @dpa99c works perfectly! Ironically i had done something similar last night just to try it out and your change at the very least proved my native ios skills weren't to bad ;-)

Thanks again

@dpa99c dpa99c closed this as completed in da06cb4 Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request ios relates to iOS platform
Projects
None yet
Development

No branches or pull requests

2 participants