"FIRMessaging is already connected" error on iOS
See original GitHub issueI get this error log when my app starts. There are some logs I create in the login page. You can see the value of the token in these logs. Notice that onPushTokenReceivedCallback
is called twice. In the first one token is a string. In the second one I think it is a native object. Because of that I have to check if type of the token is string in my code.
I get the data message but iPhone doesn’t create a device notification when a new message received. This might be the result of another thing I need to fix. I will check it.
CONSOLE LOG file:///app/tns_modules/nativescript-plugin-firebase/firebase.js:2297:20: >> fcmToken refreshed: c2JSwuX3l30:APA91bEiDhkuwJPD6JolbPDYFIf-ghNR-YWQ09vi57WBdT9eZEgw_LEwQ38lYui92XbuKNNK_cBHKbCXDJDzvY_T_svDCxJNhmlFkaW8BuK8ZDfJEJ0yLfNnjCawC875yGn06-yNeib5
CONSOLE LOG file:///app/pages/login/login.component.js:73:28: token is c2JSwuX3l30:APA91bEiDhkuwJPD6JolbPDYFIf-ghNR-YWQ09vi57WBdT9eZEgw_LEwQ38lYui92XbuKNNK_cBHKbCXDJDzvY_T_svDCxJNhmlFkaW8BuK8ZDfJEJ0yLfNnjCawC875yGn06-yNeib5
CONSOLE LOG file:///app/pages/login/login.component.js:75:32: this is string
CONSOLE LOG file:///app/pages/login/login.component.js:73:28: token is NSConcreteNotification 0x1c084f060 {name = com.firebase.iid.notif.refresh-token; object = c2JSwuX3l30:APA91bEiDhkuwJPD6JolbPDYFIf-ghNR-YWQ09vi57WBdT9eZEgw_LEwQ38lYui92XbuKNNK_cBHKbCXDJDzvY_T_svDCxJNhmlFkaW8BuK8ZDfJEJ0yLfNnjCawC875yGn06-yNeib5}
CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:569:26: Unhandled Promise rejection: Error Domain=com.google.fcm Code=2001 "FIRMessaging is already connected" UserInfo={NSLocalizedFailureReason=FIRMessaging is already connected} ; Zone: <root> ; Task: null ; Value: Error Domain=com.google.fcm Code=2001 "FIRMessaging is already connected" UserInfo={NSLocalizedFailureReason=FIRMessaging is already connected} undefined
CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:571:22: Error: Uncaught (in promise): Error Domain=com.google.fcm Code=2001 "FIRMessaging is already connected" UserInfo={NSLocalizedFailureReason=FIRMessaging is already connected}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to deal with errors with FIRMessaging (un) ...
Sometimes when I call [[FIRMessaging messaging] subscribeToTopic:myTopic] (or unsubscribe) I see errors logged in the console.
Read more >FIRMessaging is already connected, iOS push notifications
I have been stuck on this issue for days now. I have had push notifications for iOS working however now I cannot get...
Read more >Send a test message to a backgrounded Apple app - Firebase
Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab. In APNs...
Read more >If your iPhone or iPad won't connect to a Wi-Fi network
If you still can't connect to your network or get online, make sure that your router is connected to the modem and turned...
Read more >Firebase Cloud Messaging for iOS: Push Notifications
Build and run on either a real device or in a simulator, for now. Screenshot of the app running, showing two good news...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks guys, if everything is working and you see this message, it simply means the plugin tries to reconnect when it’s already connected - no harm.
maint.ts
require(“nativescript-plugin-firebase”);