{ "id": "163508", "key": "AC-4516", "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": "2016-09-28T16:26:19.000+0000", "created": "2016-09-28T02:15:26.000+0000", "labels": [ "ios", "ios-10" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-09-29T03:10:43.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "in iOS 10 scheduleLocalNotification are not working\r\n\r\ntested bellow code with iOS 9.x and its works as expected. \r\nwith TI sdk 5.5 and its working but not with iOS 10\r\n\r\n\r\n{code:java}\r\n// Some comments here\r\nTi.App.iOS.scheduleLocalNotification({\r\n date: new Date(new Date().getTime()),\r\n alertBody: \"Hello\",\r\n alertAction: \"Re-Launch!\",\r\n badge: 1,\r\n sound:\"pop.caf\", \r\n});\r\n{code}\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Ti.App.iOS.scheduleLocalNotification not working with iOS 10", "creator": { "name": "djayamaha", "key": "djayamaha", "displayName": " Dharshana Jayamaha ", "active": true, "timeZone": "Asia/Singapore" }, "subtasks": [], "reporter": { "name": "djayamaha", "key": "djayamaha", "displayName": " Dharshana Jayamaha ", "active": true, "timeZone": "Asia/Singapore" }, "environment": "MAC OS 10.12\r\nXCODE 8\r\nTI SDK 5.5 \r\niOS 10\r\n", "comment": { "comments": [ { "id": "397527", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "You need to register the notification-settings beforehand, like state din our [guides|http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Local_Notifications]. \r\n\r\nFull example:\r\n{code:javascript}\r\n\r\n// Create notification actions\r\nvar acceptAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: \"ACCEPT_IDENTIFIER\",\r\n title: \"Accept\",\r\n activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND,\r\n destructive: false,\r\n authenticationRequired: true\r\n});\r\n\r\nvar rejectAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: \"REJECT_IDENTIFIER\",\r\n title: \"Reject\",\r\n activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND,\r\n destructive: true,\r\n authenticationRequired: false\r\n});\r\n\r\n// Create a notification category\r\nvar downloadContent = Ti.App.iOS.createUserNotificationCategory({\r\n identifier: \"DOWNLOAD_CONTENT\",\r\n actionsForDefaultContext: [acceptAction, rejectAction]\r\n}); \r\n\r\n// Register for user notifications and categories\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_BADGE,\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND\r\n ],\r\n categories: [downloadContent]\r\n});\r\n\r\n// Monitor notifications received while app is in the background\r\nTi.App.iOS.addEventListener('localnotificationaction', function(e) {\r\n if (e.category == \"DOWNLOAD_CONTENT\" && e.identifier == \"ACCEPT_IDENTIFIER\") {\r\n Ti.API.warn(\"start download\");\r\n }\r\n \r\n // Reset the badge value\r\n if (e.badge > 0) {\r\n Ti.App.iOS.scheduleLocalNotification({\r\n date: new Date(new Date().getTime() + 3000),\r\n badge: \"-1\"\r\n });\r\n }\r\n Ti.API.warn(e);\r\n Ti.API.warn(\"event: localnotificationaction\");\r\n});\r\n\r\nTi.App.iOS.addEventListener(\"usernotificationsettings\", function(e) {\r\n Ti.API.warn(\"event: usernotificationsettings\");\r\n})\r\n\r\n// Monitor notifications received while app is in the foreground \r\nTi.App.iOS.addEventListener('notification', function(e) { \r\n Ti.API.warn(\"event: notification\");\r\n});\r\n\r\n// App UI\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nvar button = Ti.UI.createButton({title: 'Trigger Notification'});\r\n\r\nbutton.addEventListener('click', function(e){ \r\n // Send a notification in 3 seconds\r\n var note = Ti.App.iOS.scheduleLocalNotification({\r\n date: new Date(new Date().getTime() + 3000),\r\n alertTitle: \"My download\",\r\n alertSubtitle: \"Check it out!\",\r\n alertBody: \"New content available! Download now?\",\r\n badge: 1,\r\n attachments: [{\r\n identifier: \"my_attachment\",\r\n url: \"default_app_logo.png\"\r\n },{\r\n identifier: \"my_attachment2\",\r\n url: \"default_app_logo.png\"\r\n }],\r\n userInfo: {\"url\": \"http://www.download.com/resource/asset.json\", id:\"1\"},\r\n category: \"DOWNLOAD_CONTENT\"\r\n }); \r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-28T16:26:19.000+0000", "updated": "2016-09-28T16:26:19.000+0000" }, { "id": "397593", "author": { "name": "djayamaha", "key": "djayamaha", "displayName": " Dharshana Jayamaha ", "active": true, "timeZone": "Asia/Singapore" }, "body": "@hans\r\n\r\nActually i have register the nofitication-settings beforehand. As i mention this issue only in iOS 10.\r\n\r\nand I also tested code sample you have posted above in iOS 9 and iOS 10 with TI SDK 5.5\r\n\r\nresult :: \r\niOS 9, I function works as expected. \r\niOS 10, function not working \r\n\r\n", "updateAuthor": { "name": "djayamaha", "key": "djayamaha", "displayName": " Dharshana Jayamaha ", "active": true, "timeZone": "Asia/Singapore" }, "created": "2016-09-29T02:58:01.000+0000", "updated": "2016-09-29T03:10:43.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }