{ "id": "132395", "key": "TIMOB-17238", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-08-28T22:52:31.000+0000", "created": "2014-06-29T07:57:47.000+0000", "epic": { "id": 134538, "key": "TIMOB-17486", "name": "iOS8: Support iOS 8 functionality", "summary": "iOS8: Support iOS 8", "color": { "key": "color_5" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "ios8" ], "versions": [], "issuelinks": [ { "id": "39845", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "134641", "key": "TIDOC-1835", "fields": { "summary": "iOS8 Interactive Notifications", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "41022", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "136465", "key": "TIMOB-17683", "fields": { "summary": "iOS8: call registerUserNotificationSettings when Ti.Network.registerForPushNotifications() is called", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-09-18T18:11:29.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": "iOS 8 brings a new feature that allows users to perform actions against notifications. A short writeup is here:\r\n\r\nhttp://techcrunch.com/2014/06/02/actionable-push-notifications/\r\n\r\nApple has added notification action support so that user can immediately handle notifications in the home screen or lock screen, without the user having to enter the app. To enable this for both local and remote notifications, the following steps have to followed:\r\n1. Create and Configure Notification Actions\r\n2. Create and assign Notification Actions to Notification Categories\r\n3. Register the Notification Categories and Notification Types\r\n4. After which, add event listeners for notifications received while the app is active, or in background.\r\n\r\n*Detailed Steps:*\r\n*1. Create and Configure Notification Actions*\r\n\r\n{code:javascript}\r\nvar acceptAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: \"ACCEPT_IDENTIFIER\",\r\n title: \"Accept\",\r\n activationMode: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_BACKGROUND,\r\n destructive: false,\r\n authenticationRequired: false\r\n}) ;\r\n{code}\r\n\r\nkey parameters: \r\nactivation Mode: NOTIFICATION_ACTIVATION_MODE_BACKGROUND, NOTIFICATION_ACTIVATION_MODE_FOREGROUND\r\ndetermines where app should be activated when user selects this action\r\ndestructive: if this action does something permanent like delete\r\nauthenticationRequired: if this action needs user to enter pin to continue\r\n\r\n*2.Create and assign Notification Actions to Notification Categories*\r\n\r\n{code:javascript}\r\nvar backgroundCategory = Ti.App.iOS.createUserNotificationCategory({\r\nidentifier: \"BACKGROUND_CATEGORY\",\r\nactionsForDefaultContext: [acceptAction, maybeAction, declineAction],\r\nactionsForMinimalContext: [acceptAction, declineAction]\r\n});\r\n{code}\r\n\r\nkey parameters: \r\nactionsForDefaultContext: default actions to show. Will show all if user has set app to display notifications in alert style.\r\nactionsForMinimalContext(optional) : actions to show when user has set app to display notifications in banner style, and in lock screen.\r\n\r\n*3.Register the Notification Categories and Notification Types*\r\n\r\n{code:javascript}\r\nTi.App.iOS.registerForLocalNotifications({\r\ntypes: Ti.App.iOS.NOTIFICATION_TYPE_SOUND | Ti.App.iOS.NOTIFICATION_TYPE_ALERT,\r\ncategories: [backgroundCategory,backgroundLockCategory,foregroundCategory]\r\n});\r\n{code}\r\n\r\nNote: categories: nil will allow local notifications to work without actions\r\n\r\n*4.Add event listeners* \r\n{code:javascript}\r\n// for notifications received while app is in foreground \r\nTi.App.iOS.addEventListener('notification',function(e) \r\n{ \r\nvar content = e.userInfo.content; \r\n//do stuff with notification received \r\n});\r\n//for notifications received while app is in background\r\nTi.App.iOS.addEventListener('backgroundNotification',function(e)\r\n{\r\nvar content = e.userInfo.content;\r\nvar identifier = e.identifier;\r\n//do stuff with notification received\r\n});\r\n{code}\r\n\r\nNote: To enable interactive remote notifications, steps 1 to 3 should be done as well. Followed by Ti.Network.registerForPushNotifications. Require ACS to add additional field \"category\" to aps push packet, so that we can enable this for remote notifications.", "attachment": [ { "id": "50858", "filename": "notificationSample.js", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-29T07:51:39.000+0000", "size": 5584, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "iOS8: Add support for Interactive Notifications", "creator": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 175, "state": "closed", "name": "2014 Sprint 17 SDK", "startDate": "2014-08-21T22:07:00.000Z", "endDate": "2014-08-30T00:00:00.000Z", "completeDate": "2014-09-02T19:56:25.517Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "311783", "author": { "name": "jamessugrue", "key": "jamessugrue", "displayName": "James Sugrue", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Details can be found on this feature in the WWDC talk \"What's New in iOS Notifications\" from 10:00 \r\n\r\nThe class in question seems to be UIMutableUserNotificationAction \r\n\r\n", "updateAuthor": { "name": "jamessugrue", "key": "jamessugrue", "displayName": "James Sugrue", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-01T10:28:47.000+0000", "updated": "2014-07-01T10:28:47.000+0000" }, { "id": "320342", "author": { "name": "underlabs", "key": "underlabs", "displayName": "Joseph Sachs", "active": true, "timeZone": "America/Montreal" }, "body": "maybeAction & declineAction are missing. I'm assuming it's similar to acceptAction?\r\n\r\nexample:\r\n{code}\r\nvar maybeAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: \"MAYBE_IDENTIFIER\", // is this right?\r\n title: \"Maybe\",\r\n activationMode: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_BACKGROUND,\r\n destructive: false,\r\n authenticationRequired: false\r\n}) ;\r\n{code}", "updateAuthor": { "name": "underlabs", "key": "underlabs", "displayName": "Joseph Sachs", "active": true, "timeZone": "America/Montreal" }, "created": "2014-08-26T14:14:35.000+0000", "updated": "2014-08-26T14:14:35.000+0000" }, { "id": "320362", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR is https://github.com/appcelerator/titanium_mobile/pull/5988", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-26T15:05:45.000+0000", "updated": "2014-08-26T15:05:45.000+0000" }, { "id": "320481", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~underlabs] Yes it is.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-26T23:06:45.000+0000", "updated": "2014-08-26T23:06:45.000+0000" }, { "id": "320908", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR Merged", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-28T22:52:31.000+0000", "updated": "2014-08-28T22:52:31.000+0000" }, { "id": "323042", "author": { "name": "timanrebel", "key": "timanrebel", "displayName": "Timan Rebel", "active": true, "timeZone": "Europe/London" }, "body": "Wouldn't it have been better to give registerForLocalNotifications a more generic name, like registerForNotifications? Because to register for Push Notifications, you have to take the exact same native steps in iOS8, afaik. (Both are called UserNotifications).\r\n\r\nNow you first have to call registerForLocalNotifications and then Ti.Network.registerForPushNotifications. The latter no longer requesting permission (because the former already did). For me this was very confusing at first, until I took a look at the native iOS implementation.\r\n\r\nFor more info see: https://developer.apple.com/videos/wwdc/2014/#713", "updateAuthor": { "name": "timanrebel", "key": "timanrebel", "displayName": "Timan Rebel", "active": true, "timeZone": "Europe/London" }, "created": "2014-09-11T10:32:46.000+0000", "updated": "2014-09-11T10:32:46.000+0000" }, { "id": "323133", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng], thoughts?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-11T19:15:29.000+0000", "updated": "2014-09-11T19:15:29.000+0000" }, { "id": "323172", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "All, please see TIMOB-17683 as well. Thoughts appreciated.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-11T22:45:58.000+0000", "updated": "2014-09-11T22:45:58.000+0000" }, { "id": "324547", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified the fix in TIMOB-17640 and TIMOB-17707.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-18T18:11:03.000+0000", "updated": "2014-09-18T18:11:03.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }