{ "id": "174110", "key": "TIMOB-27386", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20827", "name": "Release 8.2.0", "archived": false, "released": true, "releaseDate": "2019-09-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-09-16T09:28:53.000+0000", "created": "2019-09-09T13:12:07.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "engSchedule" ], "versions": [ { "id": "20827", "name": "Release 8.2.0", "archived": false, "released": true, "releaseDate": "2019-09-19" }, { "id": "20845", "name": "Release 8.1.1", "archived": false, "released": true, "releaseDate": "2019-08-29" } ], "issuelinks": [ { "id": "59074", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175937", "key": "TIMOB-28307", "fields": { "summary": "Ti.UI.PushNotification Test Suite: Titanium.UI.PushNotification Acceptance TIMOB-27386 iOS Only", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "updated": "2021-01-06T08:42:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5.Description\r\n\r\nOn iOS 13 registering for push notifications returns an invalid device token, this is because the way we decode the device token has been broken by apple (although it seems it wasnt a recommended way anyways)\r\n\r\nSee https://github.com/OneSignal/OneSignal-iOS-SDK/pull/509\r\n\r\n{code}\r\nTi.App.iOS.addEventListener('usernotificationsettings', function registerForPush() {\r\n \r\n // Remove event listener once registered for push notifications\r\n Ti.App.iOS.removeEventListener('usernotificationsettings', registerForPush); \r\n \r\n Ti.Network.registerForPushNotifications({\r\n success: deviceTokenSuccess,\r\n error: deviceTokenError,\r\n callback: receivePush\r\n });\r\n});\r\n \r\n// Register notification types to use\r\nTi.App.iOS.registerUserNotificationSettings({\r\n types: [\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT,\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND,\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE\r\n ]\r\n});\r\n \r\n// Process incoming push notifications\r\nfunction receivePush(e) {\r\n alert('Received push: ' + JSON.stringify(e));\r\n}\r\n// Save the device token for subsequent API calls\r\nfunction deviceTokenSuccess(e) {\r\n\tconsole.log('Yay it worked!');\r\n\tconsole.log(e);\r\n}\r\n \r\nfunction deviceTokenError(e) {\r\n\tconsole.log('Failed to register for push notifications! ' + e.error);\r\n\tconsole.log(e);\r\n}\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Add the below code to an app.js or alloy.js\r\n\r\nh5.Actual\r\n\r\nThe device token printed looks like \r\n{code}\r\n{length=32,bytes=0x17b4427542a3d1e6a4d69d976b4539bc...7edb18a21200a8d2}\r\n{code}\r\n\r\nh5.Expected\r\n\r\nThe device token should look like\r\n\r\n{code}\r\n17b4427542a3d1e6a4d69d976b4539bcf227f216b02b5fd97edb18a21200a8d2\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Correctly decode push notification token", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "SDK: 8.2.0.v20190906153418\r\niOS 13", "closedSprints": [ { "id": 1161, "state": "closed", "name": "2019 Sprint 18", "startDate": "2019-08-26T21:46:26.269Z", "endDate": "2019-09-08T21:46:00.000Z", "completeDate": "2019-09-09T20:39:58.761Z", "originBoardId": 114 }, { "id": 1163, "state": "closed", "name": "2019 Sprint 19", "startDate": "2019-09-09T20:43:13.091Z", "endDate": "2019-09-22T20:43:00.000Z", "completeDate": "2019-09-23T15:37:35.874Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "451215", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/11202\r\n8_2_X: https://github.com/appcelerator/titanium_mobile/pull/11203", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-09-09T14:27:56.000+0000", "updated": "2019-09-09T14:27:56.000+0000" }, { "id": "451257", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "fixed 8_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/11207", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-09-10T13:51:37.000+0000", "updated": "2019-09-10T13:51:37.000+0000" }, { "id": "451259", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting on Jenkins builds for Master and 8_2_X.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-10T14:14:50.000+0000", "updated": "2019-09-10T14:14:50.000+0000" }, { "id": "451324", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "master PR was already merged. Merged 8_2_X PR.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-09-12T14:55:43.000+0000", "updated": "2019-09-12T14:55:43.000+0000" }, { "id": "451391", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket. Fix verified in SDK version {{8.2.0.v20190912104344}} and SDK version {{8.3.0.v20190913104800}}.\r\n\r\nTest and other information can be found at: \r\nmaster: https://github.com/appcelerator/titanium_mobile/pull/11202\r\n8_2_X: https://github.com/appcelerator/titanium_mobile/pull/11203", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-16T09:28:45.000+0000", "updated": "2019-09-16T09:28:45.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }