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(messaging): Throw exception if APNS token is not yet available #11400

Merged
merged 10 commits into from Aug 23, 2023

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Jul 31, 2023

Description

The Apple event handler that receives the APNS token may not have been called before the User starts to make API requests such as getToken() & subscribeToTopic(). We have set an exception when it isn't set and also updated documentation to reflect the requirement.

Related Issues

closes #10625
closes #10656

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@@ -144,8 +144,20 @@ To retrieve the current registration token for an app instance, call
ask the user for notification permissions. Otherwise, it returns a token or
rejects the future due to an error.

Warning: From iOS SDK 10.4.0 and higher, it is a requirement that the APNS token
Copy link
Member Author

Choose a reason for hiding this comment

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

hey @kevinthecheung - documentation update that could do with a review, please 😄

docs/cloud-messaging/client.md Outdated Show resolved Hide resolved
docs/cloud-messaging/client.md Outdated Show resolved Hide resolved
@russellwheatley russellwheatley merged commit 346d602 into master Aug 23, 2023
21 checks passed
@russellwheatley russellwheatley deleted the messaging-10625 branch August 23, 2023 16:47
exaby73 pushed a commit that referenced this pull request Sep 3, 2023
…11400)

Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
@msarkrish
Copy link

@russellwheatley I have one doubt. I'm getting this exception, While calling subscribeToTopic method in iOS.
My question is it mandatory to make call getAPNSToken() method before calling subscribeToTopic method?

Or What I have to do to avoid this exception?

@firebase firebase locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants