Apple device do not sign up for an APNS token on iOS 13.1
micheladasme opened this issue ยท 21 comments
Expected Behaviour
Apple device with iOS 13.1 should have an APNS token.
Actual Behaviour
Apple device with iOS 13.1 does not register an APNs token.
Reproduce Scenario (including but not limited to)
Steps to Reproduce
- Install plugin push version 2.3.0
- Make a build for iOS
- Running App with device connected in XCode 11.0
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS 13.1
Cordova CLI version and cordova platform version
cordova --version # 8.1.2
cordova platform version ios # 5.0.1
Plugin version
cordova plugin version | grep phonegap-plugin-push # 2.3.0
Logs taken while reproducing problem.
I am also having issues with registering devices on ios 13 and above. I get no error, but the registration success or error are not being called (debugged plugin's native source code as well). This is my log:
2019-10-03 23:15:49.510472+0200 [7196:4173537] success clearing all notificatons
2019-10-03 23:15:49.512681+0200 [7196:4173537] Push Plugin VoIP missing or false
2019-10-03 23:15:49.513758+0200 [7196:4173977] Push Plugin register called
2019-10-03 23:15:49.513939+0200 [7196:4173977] PushPlugin.register: setting badge to true
2019-10-03 23:15:49.514884+0200 [7196:4173977] PushPlugin.register: clear badge is set to 1
2019-10-03 23:15:49.520446+0200 [7196:4173977] PushPlugin.register: better button setup
2019-10-03 23:15:49.521240+0200 [7196:4173977] FCM Sender ID (null)
2019-10-03 23:15:49.521387+0200 [7196:4173977] Using APNS Notification
For me it turns out was all related to the provisioning profiles. I dropped all profiles and recreated new ones, selected the proper debug and release profiles and it started again registering the device for push. Maybe it is related to the new certificates apple introduced with xcode 11.
Could this be the reason?! https://nshipster.com/apns-device-tokens/
Thanks for your comments, the weirdest thing is that if you get an APN`s token when I run the app on an iOS 12, but when I run it with an iOS 13 it fails.
@paulincai This was fixed in 2.3.0, but I don't think it relates to this issue. The blog post is about the different token format in iOS 13, but this issue is about not even getting a token.
I had to renew my provisioning profiles (like suggested above), then delete the platforms folder and rebuild for iOS.
I am using ionic3 now.
Plugin version:
"cordova-ios": "4.5.5",
"phonegap-plugin-push": "^2.2.3"
Code:
pushObject.on('registration').subscribe((data: any) => {
console.log('device token -> ' + data.registrationId);
});
An app that was once compiled with Xcode 10.x has now been released, and the push token it gets works as expected:
On iOS 12.1.2
device token -> 333bbe05e3a69b85d34975f0bce598fca396dd26c0af9eb904bac4d0d2539cc3
On iOS 13.1.2
device token -> 69b72fb305be897dcff004260e9a12b5c96740a38d9efcbff75198bc304325c2
Now using Xcode 11.1 compiled application, the push token it gets works as expected on iOS 12.1.2, but it doesn't work as expected in iOS 13.1.2:
On iOS 12.1.2
device token -> c747fcfdecbcfaef8d800e35c9aaf9687542c806a75975508e83fc806e73b9c7
On iOS 13.1.2
device token -> {length=32,bytes=0x61a941c6799e63043d5366de0b865cbf...781fd5936a7efdc6}
What caused this problem to happen?
Has this issue been fixed in 2.3.0?
Hi @13546777510,
I have the same problem.
Anyone have found a solution?
Thanks in advance
Thanks, I'll provide!
iOS 13.1.3 jinxed it again for me. Now on('registration')
never gets called and the devices don't receive a token.
@ambr89 I solved this problem by upgrading the plugin version.
can you please mention which version you upgraded also please mention from versions, that it can help someone to find the real issue.
Is your problem related to that maybe ? https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/
For me, the registration happens but the registrationId object has changed. Here's what I get now :
registrationId: "{length=32,bytes=0x1f06f377fe1f3cb0009452b35637d358...6ef329e5107d...}
can you please mention which version you upgraded also please mention from versions, that it can help someone to find the real issue.
2.3.0
Hi @roxteddy
yes, I had the same problem, but if you update the plugin to lasted version (2.3.0) works!
@ambr89 oooh I am 2.2.3.. stupid me
I am so used to unmaintained cordova plugins that I was already working on a fork and I achieved to fix the problem. 1st time in objective-c. I'm proud ^^
Now I will just upgrade the plugin :S
Can you help me how to get the APN's device token. I am using
phonegap-plugin-push 2.2.3
ios - 4.5.5.
I am gettting the below logs while I am running
2019-11-01 16:16:17.111252+0530 HelloCordova[1540:374069] Push Plugin VoIP missing or false
2019-11-01 16:16:17.112700+0530 HelloCordova[1540:374134] Push Plugin register called
2019-11-01 16:16:17.112855+0530 HelloCordova[1540:374134] PushPlugin.register: setting badge to false
2019-11-01 16:16:17.112906+0530 HelloCordova[1540:374134] PushPlugin.register: clear badge is set to 0
2019-11-01 16:16:17.112958+0530 HelloCordova[1540:374134] PushPlugin.register: better button setup
2019-11-01 16:16:17.113264+0530 HelloCordova[1540:374134] FCM Sender ID (null)
2019-11-01 16:16:17.113326+0530 HelloCordova[1540:374134] Using APNS Notification
2019-11-01 16:16:19.867861+0530 HelloCordova[1540:374069] active
2019-11-01 16:16:19.868196+0530 HelloCordova[1540:374069] PushPlugin skip clear badge
Can you guys help me on this
@arulraj711 Check the provisioning profiles. I had the same problem, nothing logged and also the device would not register. I just created new certificates and profiles, all started working again.
@gertgjoka I created a new certificate and profiles but still, I face the same issue.
onDeviceReady: function() {
this.receivedEvent('deviceready');
app.push = PushNotification.init({
"ios": {
"sound": true,
"vibration": true,
"badge": true
}
});
app.push.on('registration', function(data) {
alert(data.registrationId);
});
app.push.on('notification', function(data) {
console.log('notification event');
});
app.push.on('error', function(e) {
alert("push error = " + e.message);
});
},
Hi. I updated to 2.3.0 version. The app works but the pushObject.on('registration') is never called. I updated all the certificates and prov profiles, but It's still not working
Hi,
Any solution plz ?
phonegap-plugin-push": "^2.3.0"
I have phonegap 9, plugin 2.3.0
I have same issue. I am XCode downloaded today.
2020-03-30 14:42:32.607016-0700 OwOhHo[3398:78499] GCM Sender ID (null)
2020-03-30 14:42:32.607506-0700 OwOhHo[3398:78499] Using APNS Notification
2020-03-30 14:42:32.614260-0700 OwOhHo[3398:78119] Push Plugin register failed