-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Issue #2788: fixed breaking change of APNs deviceToken format for iOS 13 #2808
Issue #2788: fixed breaking change of APNs deviceToken format for iOS 13 #2808
Conversation
Oh...CI fails with JS error. It's not my fault (I touched only objc) |
Having this issue as well, is this a working solution? |
Any progress on it? |
Hi @Nkzn! Thanks for fixing this issue. It seems the build is failing because your Here's your .travis.yml file: https://github.com/Nkzn/phonegap-plugin-push/blob/fix-ios13-devicetoken-breaking-change/.travis.yml
... and if you check on master, https://github.com/phonegap/phonegap-plugin-push/blob/master/.travis.yml
It seems your Ping me if you need help with this or don't have time and I'll open a separate PR that incorporates your fix. We're using this in production, so we're quite anxious to get this fixed before iOS 13 is released. |
…rmat for iOS 13
8ce5272
to
f1f1ce8
Compare
Hi, @coreymcmahon ! thunk you for great advice. I rebased the branch. |
Anyone knows who is the member should i reply to? |
Hi, @purplecabbage ! Could you review this PR? |
I believe @purplecabbage merged the last few PRs, perhaps they can take a look? |
Having this merged soon would be tremendously good timing! A new release would also be handy. |
Many thanks @Nkzn, @purplecabbage and @coreymcmahon for getting this change through. I am sure there will be many devs waking up today to find this an important change. |
Merge pull request phonegap#2808 from Nkzn/fix-ios13-devicetoken-breaking-change
I am facing the same issue even after upgrading the plugin. Notifications are working fine with iOS 12 devices but they are not working on iOS 13 devices. Can somebody please guide me? |
We have an issue that none of iphone devices works with latest version. All iphone devices we tested are not being registered for push notifications. No issues with android. What can be the reason? |
I am also facing issue with device registration. |
hmm... 🤔 push.on('registration', (data) => {
console.log(data.registrationId);
}); what is your result above? @PC-Nitin @kamiljackiewicz if it start with Or there are several other possible causes.
|
Hello, I can see the version as 2.3.0 in conig.xml and after running the app I can see the format of registrationid as "{length = 32, bytes =..., in device logs. |
hi, @PC-Nitin . thank you for confirm. it is strange state... if you opened your project with xcode, |
Okay! please try it! |
I am running v2.3.0, can see the changed code above but am still not getting just the token on push registration. |
@alex-steinberg and @Nkzn |
@PC-Nitin I see it is resolved, thank you. I was misled by the NSLog which fires before the OS discrimination (line 363 of PushPlugin.m). |
This thread has been automatically locked. |
Description
Fix parsing method for registered device token. On iOS 12 or lower, it will work as before. On iOS 13 or higher, new
hexadecimalStringFromData
method makes binary to hexadecimal string.The following article was helpful:
Related Issue
Motivation and Context
Until iOS 12, the result of
[deviceToken description]
was like"<124686a5 556a72ca d808f572 00c323b9 3eff9285 92445590 3225757d b83967be>"
, so we only had to remove the symbols and spaces.However, on iOS 13, the result of
[deviceToken description]
becomes"{length = 32, bytes = 0xd3d997af 967d1f43 b405374a 13394d2f ... 28f10282 14af515f}"
, and deviceToken cannot be extracted by the previous conversion. The broken token is provided as the data foron('registration', callback)
.With this fix, both formats can be handled.
How Has This Been Tested?
iPad 6Gen iOS@13.0.0
iPhone 8 iOS@12.4
Cordova@8.1.2
Cordova ios@5.0.0
Xcode@11.0 beta (11M336w)
On iOS13, following log shows hexadecimal string like
124686a5556a72cad808f57200c323b93eff9285924455903225757db83967be
.And on iOS 12 works same.
Screenshots (if appropriate):
N/A
Types of changes
Checklist: