-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Incorrect APNS token is getting generated by phonegap-push-plugin when the app contain the firebase plugin for analytics #2784
Comments
I had the same problem. All you have to do is edit your GoogleService-Info.plist and change this: |
@matscav Thank you so much! It's working now!!! |
@matscav : We tried this approach. For the first time we are able to generate the APNS token with this and we are able to capture this token and send to our backend but again I don't know somehow again FCM token gets generated. Can you please help us on this. const options: PushOptions = { |
@paamrutk are you sure you are getting the FCM token locally? It seems pretty clear from the code that Can you post your logs here? When I run this with
while with APNS, I get
Can you check the type of the token and post additional logs? |
This thread has been automatically locked. |
We are using ionic cordova phonegap-push plugin for Push notifications and Firebase plugin for analytics in our ionic application.
In iOS,Push notifications are sent through APNS and in android, push notifications are sent through FCM. In android, push notifications are working fine but in iOS, push notifications are not working.
In iOS , due to the firebase setup, Google-Services-Info.plist file has been added to the project.
In PushPlugin.m file, there are bits of codes written which read the plist file and picks up the fcm sender id and the field isGCMEnabled from the plist file and generates the FCM token instead of the APNS token, which is then passed to the application.
Since the push notification services expects the APNS token instead of the FCM token, hence the push notifications are not received on the device.
Token which was getting generated before the firebase setup is:
0a8f78c2780b39b2ec80e9dc1716577e39e1dfbc13cb5f7260541a98ed3ca23d
Token which is getting generated after the firebase setup is:
cfIrBZsnSi8:APA91bFPG-R77CTV0KSmXKxuvVPlk8WFGjDWH3Sg_ZO8kcQOKNs_IPxdFHJyKTdfQjxZcGb64hom17v_HJKcIZtp4l0-ceEqz3HDhGwyYMZhJkLUeAQirtkxNoF2DFjDTqzA8CAEidAe
Please suggest the solution for this.
FYI
"@ionic-native/firebase": "^4.19.0",
"@ionic-native/push": "^4.16.0",
"phonegap-plugin-push": "^2.2.3",
ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.6
@ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, (and 22 other plugins)
System:
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
The text was updated successfully, but these errors were encountered: