-
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
Issue goes on with Cloud Messaging Push Notification to iOS device (in 5.17.0) #2438
Comments
I met exactly the same issue. Using curl and fcmToken to send push to devices that could not receive notifications, I got this similar with @Sunrise17 :
Update: I made more tests and summary goes below.
|
Any update on this? I also tried 5.17. But after the first install, subsequent tokens are not valid. I am also receiving "NotRegistered" error. |
I believe I have exactly the same issue - you launch app once after installation - push notifications work fine. But as soon as you close the app and launch it again - push-notifications are not being delivered with the following server response:
So I've looked into the Firebase detail logs in the app and that what I've found:
Firebase token obtained and can be successfully used for sending messages.
Firebase is cleaning up GCM server registrations because it detects application reset by some reason: So I've ended up adding this workaround:
Executing this code after app launch yeilds these log records:
As you see it triggered refreshing and registering a new token on Google servers again. After doing this once in all next launches of the app I can see these logs:
It looks like fine, and no reset detection and unregistering is happening. I personally think that is a very serious issue and it should be fixed ASAP. Previously we were using Firebase 4.13.0 and it was working perfectly. After updating to Firebase 5.17.0 (due to other Firebase issue fixed in updates) push notifications stop working without using the workaround. |
I am also facing this issue. Receiving notifications only once & not receiving when second time app launch. Any one have solution for this issue ?? |
Seems currently the best solution is to downgrade Firebase to 5.16.0 |
Sorry for the inconvenience. The Firebase 5.18.0 has just released and should fix the issue. Can you update and try it again? |
Updated Firebase 5.18.0 but still didn't work. |
@xiao99xiao I faced this issue in 5.16. I was using 5.16. Then first I updated to 5.17 it did not help. Downgrading to 5.15 solved my issue |
@zohaib-ehsan Actually I downgraded to 5.15 too, but maybe you should check the order you call |
@xiao99xiao Yes you are right. I changed the order also. Calling registerRemoteNotifications before fcm methods. But did not helped me. So I downgraded to 5.15. Check this.Downgrading solved this guy problem also. https://github.com/firebase/firebase-ios-sdk/issues/2365 |
@ranipanimisha94 Can you show us the log or reproduce steps after you upgrade to 5.18.0? Using FirebaseInstanceID (3.6.0) |
@chliangGoogle for Firebase push notification reproduce steps is just like this
This above steps every time I am trying same problem. And I have checked my FirebaseInstanceId is 3.6.0 |
@xiao99xiao Thanksx. Downgraded my Firebase to 5.15 solved my problem but when my fcm token refresh with new one again facing same issue stop receiving push notification. Do you have any idea regarding this ? |
@ranipanimisha94 I think you could refer to this: #2438 (comment) |
@xiao99xiao I have checked your code. My code is same as you explained. But when Token Change stop getting notification. |
@chliangGoogle , I made a clean pod install in my Project with having Firebase (5.18.0) and FirebaseInstanceId (3.6.0). Unfortunately, same issue still goes on...You can find the list as follows mentioning the updated versions of Pods used in the Project. UPDATED Component version: * Core 5.18.0, Messaging 3.3.2 |
@Sunrise17 Can you show us the log or reproduce steps after you upgrade to 5.18.0? The issue should be resolved given @ranipanimisha94's log that token stop refreshing every app starts. |
@ranipanimisha94 The original issue(5.17.0) was caused by token invalidated every time app restart, which is why you can't receive notification. Form your latest reproduce steps, seems like that issue has been resolved because you are getting the same token. Also seems like you console can't send the notification even if you downgrade to 5.15.0, so I think the reason you can't receive notification might be a separate issue. I'm able to reproduce the issue in 5.17.0, but I can't reproduce for 5.18.0, notification delivery should work once you upgrade to 5.18.0. |
@chliangGoogle , please find attached logs regarding to FirebaseInstanceID below, consisting 1st and 2nd launch of the app. Please note that during the 2nd start of the app, it is using the same fcmToken which received from 1st launch. - Log from 1st launch of the app with successful token registration that allows push notification to work well. `2019-03-07 09:53:53.738925+0300 [4770:636728] 5.18.0 - [Firebase/InstanceID][I-IID023000] No info is retrieved from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 09:53:56.888281+0300 [4770:636784] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 09:53:56.936745+0300 [4770:636784] 5.18.0 - [Firebase/InstanceID][I-IID013002] Removed cached checkin preferences from Keychain. 2019-03-07 09:53:57.072411+0300 [4770:636773] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 09:53:57.073579+0300 [4770:636773] 5.18.0 - [Firebase/InstanceID][I-IID003012] Provisioning profile has specifically provisioned devices, most likely a Dev profile. 2019-03-07 09:53:57.074677+0300 [4770:636773] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 09:53:57.127497+0300 [4770:636766] 5.18.0 - [Firebase/InstanceID][I-IID014007] Successfully deleted GCM server registrations on app reset 2019-03-07 09:53:57.470592+0300 [4770:636784] 5.18.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: J648hnnx9:APA91bG_H7Zeksdffweer345zM3-DyQsdfJJJH8983Nst9cA4vRGQuWXL0-XLLklads00JJhhxx00x0za0FOaWEZlhQWLFa9wci6LmhMkarPTIadPuaV0zxV439HZ9-2Lm0Xvw9BR24, authorizedEntity: 7040823024517, scope:* 2019-03-07 09:54:00.588440+0300 [4770:636765] 5.18.0 - [Firebase/InstanceID][I-IID014000] Fetch new token for authorizedEntity: 7040823024517, scope: * 2019-03-07 09:54:00.826734+0300 [4770:636766] 5.18.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: J648hnnx9:APA91bG_H7Zeksdffweer345zM3-DyQsdfJJJH8983Nst9cA4vRGQuWXL0-XLLklads00JJhhxx00x0za0FOaWEZlhQWLFa9wci6LmhMkarPTIadPuaV0zxV439HZ9-2Lm0Xvw9BR24, authorizedEntity: 7040823024517, scope:* - Log from 2nd launch of the app, push notification stopped to respond. `2019-03-07 10:06:46.228656+0300 [4792:639141] 5.18.0 - [Firebase/InstanceID][I-IID023000] No info is retrieved from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 10:06:46.531952+0300 [4792:639107] 5.18.0 - [Firebase/InstanceID][I-IID007002] Invalid last checkin timestamp in future. 2019-03-07 10:06:46.565783+0300 [4792:639107] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 10:06:48.300901+0300 [4792:639156] 5.18.0 - [Firebase/InstanceID][I-IID013002] Removed cached checkin preferences from Keychain. //(print in AppDelegate: func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)) 2019-03-07 10:06:48.583463+0300 [4792:639156] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 10:06:48.678833+0300 [4792:639107] 5.18.0 - [Firebase/InstanceID][I-IID003012] Provisioning profile has specifically provisioned devices, most likely a Dev profile. 2019-03-07 10:06:48.830406+0300 [4792:639182] 5.18.0 - [Firebase/InstanceID][I-IID014007] Successfully deleted GCM server registrations on app reset |
@Sunrise17 Can you show me how to gather these logs too? I'm having the same issue on my app and want to share my logs too for extra data. |
@petergzli , you can add -FIRDebugEnabled into "Arguments Passed on Launch" in Xcode Edit schemes. |
Hey guys sharing my logs here too. I haven't been getting push notifications at all for past couple weeks on my device. This log is pulled from the latest Firebase version: Firebase 5.18.0 Same exact issue on my iPhone 7, I get the notRegistered error every time. It's the same on my iPodtouch 6G 2019-03-07 00:16:22.578106-0800 unlocked[3053:259029] 5.18.0 - [Firebase/InstanceID][I-IID023000] No info is retrieved from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 00:16:22.605040-0800 unlocked[3053:259047] 5.18.0 - [Firebase/InstanceID][I-IID007006] Checkin parameters: { 2019-03-07 00:16:22.966158-0800 unlocked[3053:259029] 5.18.0 - [Firebase/InstanceID][I-IID007002] Invalid last checkin timestamp in future. 2019-03-07 00:16:24.939402-0800 unlocked[3053:259047] 5.18.0 - [Firebase/InstanceID][I-IID013002] Removed cached checkin preferences from Keychain. 2019-03-07 00:16:25.032083-0800 unlocked[3053:259047] 5.18.0 - [Firebase/InstanceID][I-IID014000] Fetch new token for authorizedEntity: 414034688860, scope: * 2019-03-07 00:16:25.072701-0800 unlocked[3053:259031] 5.18.0 - [Firebase/InstanceID][I-IID023000] No info is retrieved from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 00:16:25.206951-0800 unlocked[3053:259029] 5.18.0 - [Firebase/InstanceID][I-IID014007] Successfully deleted GCM server registrations on app reset 2019-03-07 00:16:25.951636-0800 unlocked[3053:259105] 5.18.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 00:16:35.673618-0800 unlocked[3053:259105] 5.18.0 - [Firebase/InstanceID][I-IID003012] Provisioning profile has specifically provisioned devices, most likely a Dev profile. AFTER RESTART APP BELOW2019-03-07 00:22:20.789451-0800 unlocked[3081:260596] 5.18.0 - [Firebase/InstanceID][I-IID023000] No info is retrieved from Keychain OSStatus: -25300 with the keychain query { 2019-03-07 00:22:20.792414-0800 unlocked[3081:260596] 5.18.0 - [Firebase/InstanceID][I-IID007006] Checkin parameters: { 2019-03-07 00:22:21.093440-0800 unlocked[3081:260587] 5.18.0 - [Firebase/InstanceID][I-IID007002] Invalid last checkin timestamp in future. 2019-03-07 00:22:21.836621-0800 unlocked[3081:260658] 5.18.0 - [Firebase/InstanceID][I-IID013002] Removed cached checkin preferences from Keychain. 2019-03-07 00:22:21.840845-0800 unlocked[3081:260658] 5.18.0 - [Firebase/InstanceID][I-IID021000] Unregister request to https://fcmtoken.googleapis.com/register content: X-osv=12.1.4&device=5547419840127956014&plat=2&app=com.unlocked.test&app_ver=3.3.20&X-cliv=fiid-3.3.2&delete=true 2019-03-07 00:22:22.091715-0800 unlocked[3081:260658] 5.18.0 - [Firebase/InstanceID][I-IID014007] Successfully deleted GCM server registrations on app reset |
@chliangGoogle Sorry for respnse. I attached log file. My pod is below
and Podfile.lock is
Are there any hint to solve this problem? |
@keech The debug log shows that Looks like you switch project during app runs, so token refresh is expected. Did you happen to configure two Firebase project at the same time? Since you are using multiple firebase project, I suggest you open a separate issue as this is not related to this bug. |
Hey Guys sorry for being late in the game, but this new Pod is still not working for me. Here are my logs: 2019-04-17 15:11:44.777792-0700 unlocked[629:108650] 5.20.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: { AFTER RESTART2019-04-17 15:12:48.956145-0700 unlocked[634:109400] 5.20.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: { |
@petergzli Did you happen to call [FIRInstanceID instanceID] before [FIRApp configure] during app start? |
Definitely not |
@petergzli Can you try to patch the change #2860 and see if that fixes for you? |
This broke our notifications and makes me wonder why we are using Firebase for notifications. Repo should have been rolled back immediately after a bug like this is known... |
@J-L Apologize for the inconvenience. Unfortunately this issue is not related to a particular PR but a combination of changes on how we package it and race conditions that causing keychain to be corrupted. We also can't reproduce this issue at this point because we can't reproduce with corrupted data. This issue can be resolved if you do a deleteID call to erase the corrupted data. But we are adding preventative fix #2860 to help mitigate the issue for users who still have the corrupted data and don't want to call deleteID. Please share your debug log if you can still reproduce with change #2860. |
Any chance to do "DeleteID" from server side? |
@whswee-newswav The cause is at the client's keychain which has the corrupted data, so it has to come down to client to remove the old bad data or be able to overwrite the new one. We will roll out a release with #2860 soon to fix this. In the meantime, you can patch the change in #2860 to see if that fixes your issue. |
I'm getting the following errors:
Would anyone mind explaining to me what's going on? Why does it want a key pair from my keychain? Was I supposed to add one? |
@SephReed This is just info log showing you don't have legacy keychain. This is not related to this bug. |
Thank you. |
### Environment
CocoaPods 1.6.0
Using Bolts (1.9.0)
Using BoringSSL-GRPC (0.0.2)
Using FBSDKCoreKit (4.40.0)
Using FBSDKLoginKit (4.40.0)
Using Firebase (5.17.0)
Using FirebaseAnalytics (5.6.0)
Using FirebaseAnalyticsInterop (1.2.0)
Using FirebaseAuth (5.3.1)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.3.0)
Using FirebaseDatabase (5.1.0)
Using FirebaseFirestore (1.0.1)
Using FirebaseInstanceID (3.5.0)
Using FirebaseMessaging (3.3.1)
Using GTMSessionFetcher (1.2.1)
Using Google-Mobile-Ads-SDK (7.40.0)
Using GoogleAppMeasurement (5.6.0)
Using GoogleUtilities (5.3.7)
Using Protobuf (3.6.1)
Using gRPC-C++ (0.0.6)
Using gRPC-Core (1.17.0)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
### Problem
I have problem when using FCM in iOS. When i run the code from XCode for the first time and fresh install app to the device, app starts receiving notification from Cloud Messaging Console and from my Python server without an issue. After i stop the code and run the app from the device, It stopped receiving any notification with following error below; If i delete the app and again re-install from Xcode, it starts receiving notification with new fcmToken, till i restart the app.
Received Error from Python Server;
Relevant Code:
Code in App AppDelegate.swift
The text was updated successfully, but these errors were encountered: