Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2788: fixed breaking change of APNs deviceToken format for iOS 13 #2808

Open
wants to merge 1 commit into
base: master
from

Conversation

@Nkzn
Copy link

commented Aug 20, 2019

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

  • #2788 iOS token weird format

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 for on('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.

push.on('registration', data => {
  console.log(data.registrationId);
});

And on iOS 12 works same.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Nkzn Nkzn changed the title :bug: :apple: Issue #2788: fixed breaking change of APNs deviceToken format for iOS 13 Issue #2788: fixed breaking change of APNs deviceToken format for iOS 13 Aug 20, 2019

@Nkzn

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

Oh...CI fails with JS error. It's not my fault (I touched only objc)

@jamespsterling

This comment has been minimized.

Copy link

commented Sep 5, 2019

Having this issue as well, is this a working solution?

@danielpassos

This comment has been minimized.

Copy link

commented Sep 13, 2019

Any progress on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.