{ "id": "167107", "key": "TIMOB-24580", "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": "19333", "description": "Patch release for important items that did not make it into 6.0.3", "name": "Release 6.0.4", "archived": false, "released": true, "releaseDate": "2017-04-27" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-04-26T21:29:27.000+0000", "created": "2017-04-14T01:44:55.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-04-27T17:49:59.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": "h6.Issue Detail\r\n\r\nBuilding push notification enabled iOS app for enterprise distribution with TiSDK 6.0.3.GA produces this error when registering for push notifications:\r\n{code}\r\nno valid 'aps-environment' entitlement string found for application\r\n{code}\r\n\r\nh6.Note\r\nBuilding with 6.0.1.GA works as expected. \r\n\r\nh6.Reproduce\r\n\r\n1. Add following code to default new project\r\n2. Build for enterprise distribution\r\n3. Install the generate ipa file on an iPhone\r\n4. Launch the app\r\n5. When prompted, allow push notifications\r\n6. Observe the error in the alert \"no valid 'aps-environment' entitlement string found for application\"\r\n\r\n{code}\r\nvar deviceToken = null;\r\n\r\n// Check if the device is running iOS 8 or later\r\nif (Ti.Platform.name == \"iPhone OS\" && parseInt(Ti.Platform.version.split(\".\")[0]) >= 8) {\r\n\r\n\t// Wait for user settings to be registered before registering for push notifications\r\n Ti.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\n Ti.App.iOS.registerUserNotificationSettings({\r\n\t 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\r\n// For iOS 7 and earlier\r\nelse {\r\n\r\n Ti.Network.registerForPushNotifications({\r\n // Specifies which notifications to receive\r\n types: [\r\n Ti.Network.NOTIFICATION_TYPE_BADGE,\r\n Ti.Network.NOTIFICATION_TYPE_ALERT,\r\n Ti.Network.NOTIFICATION_TYPE_SOUND\r\n ],\r\n success: deviceTokenSuccess,\r\n error: deviceTokenError,\r\n callback: receivePush\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 deviceToken = e.deviceToken;\r\n\talert('Successfully registered for push notifications!');\r\n}\r\n\r\nfunction deviceTokenError(e) {\r\n alert('Failed to register for push notifications! ' + e.error);\r\n}\r\n\r\n$.index.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: SDK upgrade to 6.0.3.GA broke push notification registration", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "Appcelerator Command-Line Interface, version 6.1.0\r\niOS 10.2 (iPhone 6S Plus)\r\nOperating System Name: macOS Sierra\r\nOperating System Version: 10.12\r\nNode.js Version: 5.11.1\r\nnpm: 3.8.6\r\nTitanium SDK Version: 6.0.3.GA\r\nXcode: 8.2.1", "closedSprints": [ { "id": 882, "state": "closed", "name": "2017 Sprint 09 Tooling", "startDate": "2017-04-23T21:40:51.921Z", "endDate": "2017-05-07T21:40:00.000Z", "completeDate": "2017-05-08T00:27:11.528Z", "originBoardId": 199 } ], "comment": { "comments": [ { "id": "417416", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Titanium SDK 6.0.3.GA requires Xcode 8.3 to be used, since the tooling was aligned to match the Xcode tooling. Please test regarding that and update this ticket afterwards.\r\n\r\n*EDIT*: Just tested with a fresh app using 6.0.3.GA and Xcode 8, copied the supplied code into the index.js and deployed it with a valid (push-entitled) provisioning profile to device and it works without issues. The used project is attached [here|https://www.dropbox.com/s/nylyk6qod58qckj/test_push.zip?dl=1].\r\n\r\nThe generated entitlements file in {{build/iphone}} includes all required keys:\r\n{code:xml}\r\n\r\n\r\n\r\n\r\n\tapplication-identifier\r\n\t6K4KHD4NQF.com.appc.pushtest\r\n\taps-environment\r\n\tdevelopment\r\n\tget-task-allow\r\n\t\r\n\tkeychain-access-groups\r\n\t\r\n\t\t6K4KHD4NQF.com.appc.pushtest\r\n\t\r\n\r\n\r\n{code}\r\nResolving as Invalid for now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-14T14:01:50.000+0000", "updated": "2017-04-14T14:25:42.000+0000" }, { "id": "418105", "author": { "name": "shockoe_andrew", "key": "shockoe_andrew", "displayName": "Andrew Rumbley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\n\r\nI'm who originally reported this issue to Axway.\r\n\r\nThanks for looking into it Hans, but we've got some discrepancies in our results. When I build that test case using TiSDK 6.0.1 and Xcode 8.2.1 my entitlements file in `build/iphone` looks like this:\r\n\r\n{{\r\n\r\n\r\n\r\n\tapplication-identifier\r\n\tZ7HX3EQHHM.com.shockoe.push.test\r\n\taps-environment\r\n\tproduction\r\n\tget-task-allow\r\n\t\r\n\tkeychain-access-groups\r\n\t\r\n\t\tZ7HX3EQHHM.com.shockoe.push.test\r\n\t\r\n\r\n}}\r\n\r\nBut when I build with TiSDK 6.0.3 and Xcode 8.3 it looks like this:\r\n{{\r\n\r\n\r\n\r\n\r\n}}\r\n\r\nAre you building for In House (enterprise) distribution? I see the aps-environment is set to development in your results, but I would expect it to be production.", "updateAuthor": { "name": "shockoe_andrew", "key": "shockoe_andrew", "displayName": "Andrew Rumbley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-26T14:56:30.000+0000", "updated": "2017-04-26T14:56:30.000+0000" }, { "id": "418106", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I see. In my test-case, I didn't. Let me give that to our QE-team and reopen it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-26T14:59:22.000+0000", "updated": "2017-04-26T14:59:22.000+0000" }, { "id": "418110", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue, using Xcode 8.3.2 and SDK 6.0.3.GA.\r\nAs described, the issue is not present when using Xcode 8.2.1 and SDK 6.0.1.GA.\r\n\r\nAndrew's/Shuo's steps are accurate for encountering the issue.\r\nTested using an Enterprise, In House Distribution Profile for an Adhoc build with Push Services enabled.\r\nI see the same discrepancy in the entitlements files as Andrew posted, above.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-04-26T16:49:43.000+0000", "updated": "2017-04-26T16:49:43.000+0000" }, { "id": "418113", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8998\r\nTi SDK 6_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/8999\r\nTi SDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/9000", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-26T17:22:20.000+0000", "updated": "2017-04-26T17:22:20.000+0000" }, { "id": "418139", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, in:\r\nMacOS 10.12 (16A323)\r\nStudio 4.8.1.201612050850\r\nAppc NPM 4.2.9-3\r\nAppc CLI 6.2.0\r\nAlloy 1.9.11\r\nXcode 8.3.2 (8E2002)\r\n\r\nPerformed enterprise adhoc/distribution builds with push enabled. Entitlements files were correctly populated and I was successfully able to register for push notifications.\r\n\r\nConfirmed fixed in SDK builds: 6.0.4.v20170426140226, 6.1.0.v20170426140837, and 6.2.0.v20170426140709", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-04-26T22:22:34.000+0000", "updated": "2017-04-26T22:22:34.000+0000" }, { "id": "418183", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "An additional note, the Ti.Platform.name for iOS 10 and higher is now \"iOS\". So in the demo code above\r\n{code}\r\nif (Ti.Platform.name == \"iPhone OS\" && parseInt(Ti.Platform.version.split(\".\")[0]) >= 8) {\r\n{code}\r\nAn additional condition needs to be added \"Ti.Platform.name == iOS\"\r\nFor reference see \"name\" entry in:\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-27T16:13:03.000+0000", "updated": "2017-04-27T16:13:03.000+0000" }, { "id": "418192", "author": { "name": "shockoe_andrew", "key": "shockoe_andrew", "displayName": "Andrew Rumbley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~amukherjee]\r\nThat's interesting. The sample code sets up correctly on iOS 10. Printing out Ti.Platform.name on iOS 10.3 Simulator shows it is still \"iPhone OS\".", "updateAuthor": { "name": "shockoe_andrew", "key": "shockoe_andrew", "displayName": "Andrew Rumbley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-27T17:49:59.000+0000", "updated": "2017-04-27T17:49:59.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }