Failed to retrieve the default FCM token after 5 retries

Jorge Jim5 years ago

Xcode shows me this error:

2019-02-24 17:24:15.887531-0600 TraccarManager[2806:61576] 5.9.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
2019-02-24 17:24:27.888022-0600 TraccarManager[2806:60770] 5.9.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
2019-02-24 17:24:51.888603-0600 TraccarManager[2806:61766] 5.9.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
2019-02-24 17:25:29.889450-0600 TraccarManager[2806:62140] 5.9.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
2019-02-24 17:26:25.890392-0600 TraccarManager[2806:62363] 5.9.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
2019-02-24 17:26:25.890822-0600 TraccarManager[2806:62363] 5.9.0 - [Firebase/InstanceID][I-IID003007] Failed to retrieve the default FCM token after 5 retries

I have a .p12 file generated, I upload it to fierebase, I install the Googleservice-info.plis in Code.
Push notifications, and keychain sharing are enabled in capabilities.

But the error persist and push notifications does not work in IOS.

Any suggestions? Maybe I have not done the needed steps...

Please, Help me.

Thanks in advance...

Anton Tananaev5 years ago

Are you running on simulator or real device?

Jorge Jim5 years ago

on both of them...

Thanks for you answer....

Anton Tananaev5 years ago

Push notifications don't work on simulator, but if everything is configured correctly, it should work on real device.

Jorge Jim5 years ago

Ok...., Everything works fine on android, but I have not have the same luck for IOS, speaking specifically of push notifications, the rest is also working fine.

Let me make more test.

Thanks a lot....

Ernesto Vallejo5 years ago

Jorge, in regards to your APN Certificates:

1- Make sure you are using correct certificates both development and production.
2- Double check app package names

If none of this helps, try removing certificates and firebase console and replace them with your APN Authentication Key.

Jorge Jim5 years ago

Ernesto.

I will check that and I will tell you the results soon.

Thank you so much..

Jorge Jim5 years ago

Ok..., After doing everything, including that Ernesto said..., It is still not working for me...

I have a question:

What should happen if I use the Original Traccar Manager App from the apple store, I connect to my server and send test notifications? Should I see the Push Notification(PN) in my Iphone device? I mean, Everything is configured in the Original App to send PN. Because, doing that test, I have no receiving PN in my device.

I just try to discard any issue. That is because, compiling the source, adding certificates, p12 file, APN Authentication key, etc. and installing the app via Xcode in my Iphone device, does not work for me.

Any suggestions??

Thanks in advance...

Anton Tananaev5 years ago

Push notifications should work on official app with demo servers.

Ernesto Vallejo5 years ago

I've been into that a few times, android does work but apple is difficult. Double check on your itunesconnect account that everything is ok. If you find yourself looping around certificates, provisioning profiles and so on, I recommend start fresh with a new package name and everything.

Jorge Jim5 years ago

Yes Ernesto, I have done that.

I will try again.

Thank you so much...

Jorge Jim5 years ago

Sorry again...

I have a basic question: Should Push Notifications work in dev (Build and Run on My device via Xcode)? I mean, should they work without needing to work in production mode (The App online and downloaded from the apple store) ?

Thanks again...

Anton Tananaev5 years ago

You need to build Google configuration.

Ernesto Vallejo5 years ago

Hi Jorge, if everything is configured properly, yes. It should work when you deploy directly to your iPhone in Xcode.

Jorge Jim5 years ago

Thank you Anton and Ernesto.

Push Notifications are working now on IOS...!!

I just noticed something.., They not work if AppDelegate.swift file has the commented lines:
#if FIREBASE, #endif

I remove those 2 commented lines and it works...

Again..., Thank you so much!!