{ "id": "133319", "key": "AC-1427", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-07-24T08:18:43.000+0000", "created": "2014-07-17T11:48:21.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:51.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": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "this is my code:\r\nTi.Network.registerForPushNotifications({\r\n\t success : function(e) {\r\n\t that.deviceToken = e.deviceToken;\r\n\tTi.App.Properties.setString('deviceToken', e.deviceToken);\r\n\t},\r\n\terror : function(e) {},\r\n\tcallback : function(e) {\r\n\t console.log('||||||||||||||||||||||||');\r\n\t console.log(e.data.alert);\r\n\t },\r\n\ttypes : [Ti.Network.NOTIFICATION_TYPE_BADGE, Ti.Network.NOTIFICATION_TYPE_ALERT, Ti.Network.NOTIFICATION_TYPE_SOUND] // [Ti.Network.NOTIFICATION_TYPE_ALERT]\r\n});\r\n\r\nIf the app is running in foreground and I send a PN from web console it works like a charm: I see the message on console inside xcode.\r\n\r\nBut If I push the home button and the app runs in background and I send a PN, then I see the notification in statusbar. If I start the app now I aspect that the event 'callback' is fired and the property 'inBavkground' is set. In this case I would read the payload etc. But no event is fired. I ask me the purpose of this new property. ", "attachment": [], "flagged": false, "summary": "iOS registerForPushNotifications from background", "creator": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "environment": "iOS7 ti.cloud_3.2.3", "comment": { "comments": [ { "id": "315595", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nThe behaviour you mentioned is normal. When you received a push notification, callback function will be fired. But the action of your callback function is output log in console, that is only supported for foreground app. When the app is in background, console.log or alert actions will not work. Once you switch the app to foreground, the action will appear.\r\n\r\nRegards,\r\nShuo ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-24T08:18:19.000+0000", "updated": "2014-07-24T08:18:19.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }