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}
Same issue here
It seems like I forgot to add the APN's auth key to the firebase console cloud messaging settings (firebase console -> yourApp -> Settings -> Cloud Messaging settings).
also make sure to read this guide
Are you sure that this solved the problem? I added it but still get the error message.
@erkanarslan
I was going through a lot in this issue...I will just tell you what I did and see if you didn't do it:
platforms/ios/YourAppName/(Resources/)YourAppName.entitlements file, take it and put it in your app/App_Resources/IOS folder.app/App_Resources/iOS/Info.plist:<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
bundle id and upload the APN's Key file that you get from the last guideReally hope I remembered all the things I did :)
I did all of these already. Push notifications are working but I still get
this message when app starts.
@erkanarslan
For sure the thing that solved it for me is to upload the APN's key file to the firebase ios app configuration
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.
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");
Most helpful comment
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.