I'm building an app for android and iOS using ionic v3, phonegap-plugin-push and FCM, currently I have no problem getting notifications for Android, but I'd accomplished nothing for iOS, not even a token for the device.
My App has the Push notification capabilities on Xcode and on the Developer center, I have created my APNs Certificate (.p12) registered on the Firebase Console, updated my .plist file, changed to APNs Auth Key (.p8) returned to .p12 but still not getting a token.
What am I doing wrong? what am I missing?
My code to register the device:
constructor(
_push: Push,
private _tp: ToastProvider,
private http: HttpClient,
private _events: Events
) {
this.pushObj = _push.init(this.getPushOpts());
this.pushObj.on('registration').subscribe(data => this.FCMToken = data.registrationId);
this.enablePushNotifications();
}
private getPushOpts (): PushOptions {
return {
android: {
senderID: SENDER_ID,
sound: true,
vibrate: true,
icon: 'icon',
iconColor: '#f89b3a'
},
ios: {
sound: true,
alert: true,
badge: true
}
}
}
Versions of my dependecies
"phonegap-plugin-push": "^2.2.3"
"@ionic-native/push": "^4.20.0"
"cordova-ios": "4.5.5"