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

fix(ios): correctly decode device token for ios 13 compatibility (8_2_X) #11207

Merged
merged 4 commits into from Sep 12, 2019

Conversation

ewanharris
Copy link
Collaborator

@ewanharris
Copy link
Collaborator Author

Review was done in #11203

Copy link
Contributor

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches code/changes in #11203 which was approved by @vijaysingh-axway

@sgtcoolguy sgtcoolguy added this to the 8.2.0 milestone Sep 10, 2019
@ssjsamir ssjsamir self-requested a review September 10, 2019 14:01
@build
Copy link
Contributor

build commented Sep 10, 2019

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ❌ 1 tests have failed There are 1 tests failing and 471 skipped out of 4326 total tests.
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.

Tests:

ClassnameNameTimeError
ios.os#cpus() returns array of objects whose length matches Ti.Platform.processorCount0
Error: undefined is not an object (evaluating 'modelAndSpeed[0]')
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti.main.js:7311:29
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/os.test.js:65:25
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4376:41
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4763:17
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4840:23
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4688:20
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4698:15
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4636:30
file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:4665:13
timeslice@file:///Users/build/Library/Developer/CoreSimulator/Devices/6F8AECD6-4AC3-4F0D-AD47-E1136061A74A/data/Containers/Bundle/Application/95E6F47F-B44A-4B79-8CA7-446AD2EDBAA6/mocha.app/ti-mocha.js:5764:29

Generated by 🚫 dangerJS against b4696e2

Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Passed A correct device token can be decoded. Tested with the following test case:

Ti.App.iOS.addEventListener('usernotificationsettings', function registerForPush() {
 
// Remove event listener once registered for push notifications
Ti.App.iOS.removeEventListener('usernotificationsettings', registerForPush);
 
Ti.Network.registerForPushNotifications({
success: deviceTokenSuccess,
error: deviceTokenError,
callback: receivePush
});
});
 
// Register notification types to use
Ti.App.iOS.registerUserNotificationSettings({
types: [
Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT,
Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND,
Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE
]
});
 
// Process incoming push notifications
function receivePush(e) {
alert('Received push: ' + JSON.stringify(e));
}
// Save the device token for subsequent API calls
function deviceTokenSuccess(e) {
console.log('Yay it worked!');
console.log(e);
}
 
function deviceTokenError(e) {
console.log('Failed to register for push notifications! ' + e.error);
console.log(e);
}

Test Environment

MacOS Mojave version 10.14.4
Xcode 11 beta 5
Node.js ^8.11.1
iPhone 7 (13.0 beta 7)
"NPM":"4.2.15","CLI":"7.1.1"

@sgtcoolguy sgtcoolguy merged commit 4e2bfe7 into tidev:8_2_X Sep 12, 2019
@ewanharris ewanharris deleted the TIMOB-2738682xv2 branch August 31, 2021 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants