fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 989 forks source link

iOS: Failed to fetch APNS token #61

Open floffycodes opened 7 years ago

floffycodes commented 7 years ago

Hello, I'm currently integrating this plugin in my ionic application. It works perfectly on Android, but not completely on iOS: the app asks by itself at the first launch if the user allows push notifications, and the token is found correctly, but then I can't receive any push notifications.

Here is the error shown by xcode while running: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"

And on the server side - when trying to send the notification - I have an registrationError (which is, I guess, related). I also tried with the testing server linked in the README, and even the firebase console: nothing works and no notification is received in iOS.

I did this list of tasks while trying to fix the issue:

Still get this error. And while typing this error on google (that does not seem to come from the cordova plugin), I don't get any working solution.

Did you ever get this problem? How can I solve it?

markcarey commented 7 years ago

I am seeing a similar error when targeting my iPhone from Xcode:

Failed to fetch default token Error Domain=com.firebase.iid Code=0 "(null)"

But I do not see this error in the simulator...

meghaParmar commented 7 years ago

I am getting similar error when I implement FCM with my iOS application. I am running application with Target of iPhone 5s.

Following is the error I am getting InstanceID token: (null) Unable to connect to FCM. Error Domain=com.google.fcm Code=2001 "(null)"

This error generating infinite time.

floffycodes commented 7 years ago

Having the owner not responding, I switched to the phonegap plugin push (https://github.com/phonegap/phonegap-plugin-push), and it works perfectly on both platforms with FCM.

The only thing to think of, is to precise to the plugin to use FCM tokens for ios too, and there will be no problem.

Hope it will help some people here.

sssuourabh commented 7 years ago

Looks like you are missing the correct provisioning profile. i solved after adding correct provisioning profile

hellohelloye commented 7 years ago

I met the same problem, It is quite simple. I forget to turn on the push notifications under the project targets capabilities.

christianraj commented 7 years ago

i still face this problem even after turning on push notification

Anujmoglix commented 6 years ago

I am still facing issue . Already turned it on push notification and background Modes. Still it is showing same issue in ios .Please help .issue link https://forum.ionicframework.com/t/issue-in-firebase-push-notification-in-ios/128842