fechanique / cordova-plugin-fcm

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

getToken returning null on IOS in testFlight and AppStore, but builded by USB is ok #590

Open guilhermeMkx opened 4 years ago

guilhermeMkx commented 4 years ago

I'm developing a mobile app using Ionic 3 and the cordova-plugin-fcm library. When the app starts, I get the token using the getToken() function, what works normally on Android app, but it doesn't to IOS users. I've already verified the certificates and its all working. When I run the app on emulator or on a device by building trough the USB, the token is generated and the push notifications works as expected (only in device, because IOS emulators are not able to show notifications), but for apps in TestFlight or on the App Store, the getToken() function returns only NULL. What I've tried until now:

-Generate a certificate for Push Notifications on keychain Access; -I've Activated the Push notifications for my App ID on my developer apple portal; -Created a Key for pushNotifications on developer apple portal -Upload the .p8 file to the console firebase, on IOS settings.

There is something about the certificate that I'm missing? Or it's may be a bug on the plugin?

Thank you

nystsam commented 4 years ago

+1 I have the same issue

jiseungjun commented 4 years ago

Instead of using the getToken() function, use the onTokenRefresh() function.