-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 getToken()
iOS function for messaging
#3130
Conversation
The function was returning `null` most of the time
Thanks for reviewing @Salakar. |
@anfriis not sure that's a wise call on our end, we need it to be working with no breaking changes - who knows what people have done in their projects (patch packages, local fixes etc). We'll get it looked at asap. |
What about if we call the function in this PR if the scope is undefined (defaulted to |
Any update ? |
Codecov Report
@@ Coverage Diff @@
## master #3130 +/- ##
=======================================
Coverage 89.77% 89.77%
=======================================
Files 109 109
Lines 3389 3389
=======================================
Hits 3042 3042
Misses 347 347 |
@@ -96,11 +96,11 @@ - (NSDictionary *)constantsToExport { | |||
options = @{@"apns_token": [FIRMessaging messaging].APNSToken}; |
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.
You should also drop options, as they are not used anymore.
Anders Friis seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Thanks for sending this PR up. I'm going to close it as we ended up re-writing a lot of the iOS internals as part of wider fixes on #3339. We implemented this change along with supporting scopes/auth-entities too using the previous API. |
This function often throws an exception:
Cloud Messaging "[messaging/unknown] The operation couldn’t be completed"
This fixes it and returns the FCM token successfully.
Fixes #2657
Summary
Checklist
Android
iOS
e2e
tests added or updated in packages/**/e2eTest Plan
I have tested on two different iPhone's, trying to get FCM token several times using this function, and it works now whereas it didn't before because it threw the exception above.
Release Plan
[IOS][BUGFIX] [messaging] - Fix
getToken()
iOS function for messaging[CATEGORY][type] [LOCATION] - Message
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter