question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"FIRMessaging is already connected" error on iOS

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
EddyVerbruggencommented, Dec 30, 2017

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.

0reactions
DevZatokiocommented, May 14, 2019

Ya hice todo esto. Las notificaciones push están funcionando, pero aún recibo este mensaje cuando se inicia la aplicación.

maint.ts

require(“nativescript-plugin-firebase”);

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found