{ "id": "139962", "key": "AC-870", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2014-11-18T23:47:34.000+0000", "created": "2014-11-18T17:22:18.000+0000", "labels": [ "3.4.0", "3.4.1", "ios7", "pushnotification" ], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2016-03-08T07:37:10.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": [], "description": "The following code does not result in a registration for push notification services on devices running iOS 7.1. \r\n\r\nif (Ti.Platform.name == \"iPhone OS\" && parseInt(Ti.Platform.version.split(\".\")[0]) >= 8) {\r\n // placeholder\r\n\r\n} else {\r\n // For iOS 7 and earlier\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 alert('success');\r\n}\r\n\r\nfunction deviceTokenError(e) {\r\n alert('Failed to register for push notifications! ' + e.error);\r\n}", "attachment": [], "flagged": false, "summary": "iOS 7 - registerForPushNotifications does not trigger success or error event", "creator": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "environment": "iOS 7.1, Mac OS X 10.9.5, Ti SDK 3.4.0 or 3.4.1", "comment": { "comments": [ { "id": "332765", "author": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "body": "Upon further inspection, this is not a problem with the titanium implementation of APN. It was a problem with my code.\r\n\r\nhttp://docs.appcelerator.com/titanium/3.0/#!/guide/Subscribing_to_push_notifications\r\n\r\n", "updateAuthor": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "created": "2014-11-18T20:15:49.000+0000", "updated": "2014-11-18T20:15:49.000+0000" }, { "id": "332769", "author": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "body": "FYI, the sample code on http://docs.appcelerator.com/titanium/3.0/#!/guide/Subscribing_to_push_notifications will not work for iOS 7. It is attempting to call the deviceTokenSuccess function before it is defined.", "updateAuthor": { "name": "tim_varney", "key": "tim_varney", "displayName": "Tim Varney", "active": true, "timeZone": "America/New_York" }, "created": "2014-11-18T20:33:54.000+0000", "updated": "2014-11-18T20:33:54.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }