-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Firebase does not map APNs token to FCM token in second installation of application #6766
Comments
I've find out that if I open the application for second time or third time firebase successfully register APN token and refresh my FCM token. |
Can you check if the patch in #6553 fixes this issue as well? |
Are there any cases that I'm facing a problem that at the first fresh install, i got a old token and push will not work. But the second fresh install or just second run -> new token fetched -> push work normal. |
Thanks for your response, unfortunately I've applied the patch (Just change my FIRInstanceID.m file) and it did not work. There is a delay in my code between calling After I calling |
After a lots of debugging in firebase iOS SDK , I figured it out that inside class |
It seems that if I force firebase to refresh token something like below code it will work, but i think it is not a permanent solution. Here is my part of AppDelegate.m class:
But I will keep testing. |
Thanks for the detailed investigation @shayantabatabaee. @chliangGoogle can you take a look? |
@shayantabatabaee Can you patch the change in #6669 and send us the debuglog? To enable debug logging set the following application argument: -FIRDebugEnabled (see http://goo.gl/RfcP7r) |
@morganchen12 and @chliangGoogle thanks for your time, yes I tested with the patch and full debug log is :
|
hmm i'm not able to reproduce. I'm able to get an APNS token after calling registerForRemoteNotification at a later time. Can you file a customer support issue or send me your sample code at my email chliang@google.com so we can investigate more on that. |
@chliangGoogle I'm working on creating a new project for debugging, but during the process I realized that I used one modules called RNRestart that restart my application in my splash screen. I removed restarting my application and firebase starts working but I also realized that my Firebase token at first run and the second run is different , does it seem to be normal ? |
@chliangGoogle Excuse me...Are there any cases that |
@shayantabatabaee the latest version of SDK should fix it. Can you update your cocoapod and try it again? @trungnguyen1791 What kind of issue you running into? If it's a different one, please file a separate PR. |
Hey @shayantabatabaee. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Thanks for your help, updating the sdk fix my problem, so I close the issue |
[REQUIRED] Step 1: Describe your environment
CocoaPods
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
Hello everyone,
I faced an issue that when I install iOS application for the second time and so on, the firebase SDK does not map FCM token to APN token correctly.
For the first time everything works great and I can push to application via both FCM token and APN token. In the second installation I can not push to application via FCM token but APN token works correctly.
I tested to register my APN token with Google Server API and the token that I retrieve from server is different with the token that I retrieve from inside application. It is interesting to tell that token that I retrieve from server works.
I also tested method swizzling but it did not work.
Relevant Code:
Here is my Firebase Debug Full Log:
Here is My FCM Token Log :
My APN Token Log:
My Request and Response to Google server API:
As you can see the FCM token from google server and application is different.
The text was updated successfully, but these errors were encountered: