-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update InstanceID to listen to a notification from Messaging #6286
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
Conversation
Firebase/InstanceID/CHANGELOG.md
Outdated
| @@ -1,3 +1,7 @@ | |||
| # 2020-08 -- 4.5.2 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 4.6.0 with the new functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no public API change, I guess this is for better version managing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor version updates aren't just for public API changes - they should be used for any changes that go beyond bug fixes. See https://semver.org/
When we release Messaging that removes InstanceID dependency, Messaging will handle FCM token on its own. However, developers might still depend on both Messaging and InstanceID, each has its own cache for token, but share the same storage(keychain). We need to add a method in InstanceID to listen to a notification from Messaging for token refresh, if that happens, InstanceID will update its cache, but not storage, as Messaging already updated it.
We want developers to adopt this version before hand as we can't re-enforce iid version once messaging remove it from its dependency. So I updated the new version of messaging to depend on at least this version of IID.
Manual tested in the chen/fm-master branch which has the latest version of Messaging without IID dependency.
Add/delete token from Messaging API and try getToken in InstanceID should return the same token and FID.
Minor:
Fixed an issue that the local defaultFCMToken is not updated when calling tokenWithAuthorizedEntity:scope:options:handler. This cause developers won't get notified of token update. It is not discovered probably because not so many developers use this API.