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

Fix the issue that causes the 'registration' event not to be triggered #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxs15
Copy link

@maxs15 maxs15 commented Aug 9, 2024

We noticed an issue after upgrading the Firebase iOS messaging SDK to the latest version (10.29.0). The "registration" event wasn't triggered anymore when the app starts.

This issue arises because the initRegistration method fails with the error 'The operation couldn’t be completed. No APNS token specified before fetching FCM Token' when calling the init method of the plugin. This occurs because initRegistration is executed before registerForRemoteNotifications when the push permissions are already granted.

We tested this fix in local and production and everything works as expected.

…'The operation couldn’t be completed. No APNS token specified before fetching FCM Token' when calling the init method of the plugin. This occurs because initRegistration is executed before registerForRemoteNotifications when the push permissions are already granted.
Copy link

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR.

Could you test and confirm if PR #285 resolves this issue?

I've refactored the initialization process, which I believe corrected the timing issue with FCM. This should eliminate the need for adding a delay, as seen in this PR. Adding a delay might not always provide a consistent or accurate solution, whereas the refactor should ensure proper timing without relying on arbitrary delays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants