{ "id": "159173", "key": "TIMOB-23128", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2016-07-26T09:50:24.000+0000", "created": "2016-03-31T11:05:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ios", "localnotification" ], "versions": [ { "id": "17684", "name": "Release 5.2.1", "archived": false, "released": true, "releaseDate": "2016-03-25" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-07-26T09:50:24.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": "There are missing two properties inside the {{Ti.App.iOS.scheduleLocalNotification}}:\r\n* alertTitle: The title of the alert being displayed (alertBody already covered)\r\n* region: The region in which the notification can be triggered\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: Add missing local notification properties", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "381165", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7899", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-31T11:07:41.000+0000", "updated": "2016-03-31T11:07:41.000+0000" }, { "id": "381322", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Uncomment region upon second run and a notification should not be displayed. \r\n\r\nDemo code :\r\n{code:javascript}\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\nvar notification = Ti.App.iOS.scheduleLocalNotification({\r\n alertTitle: \"Feature Test\",\r\n alertAction: \"update\",\r\n alertBody: \"New content available! Update now?\",\r\n badge: 12,\r\n date: new Date(new Date().getTime() + 3000),\r\n sound: \"/alert.wav\",\r\n userInfo: { \"url\":\"http://www.download.com/content/asset.json\"},\r\n //region:{latitude:35.6895,longitude:139.6917} //Japan\r\n}); \r\n{code}", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-01T20:54:43.000+0000", "updated": "2016-04-01T20:55:24.000+0000" }, { "id": "390088", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "I am unable to get a notification with region added, adding my demo code below;\r\n\r\n*app.js*\r\n{code:java}\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 var notification = Ti.App.iOS.scheduleLocalNotification({\r\n alertTitle: \"Feature Test\",\r\n alertAction: \"update\",\r\n alertBody: \"New content available! Update now?\",\r\n badge: 12,\r\n date: new Date(new Date().getTime() + 3000),\r\n sound: \"/alert.wav\",\r\n userInfo: { \"url\":\"http://www.download.com/content/asset.json\"},\r\n //region:{latitude:35.6895,longitude:139.6917} //Japan\r\n region:{latitude:37.36,longitude:-121.91} //office\r\n}); \r\n\r\n\r\n var authorization = Titanium.Geolocation.locationServicesAuthorization;\r\n Ti.API.info('Authorization:' + authorization);\r\n\r\n Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n Titanium.Geolocation.addEventListener('location', function(e) {\r\n Ti.API.info('Location Update ::' + JSON.stringify(e));\r\n \r\n });\r\n{code}\r\n\r\n*Reopening ticket*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-07T22:56:21.000+0000", "updated": "2016-07-07T22:56:21.000+0000" }, { "id": "390151", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR's to adjust the docs: \r\n- master: https://github.com/appcelerator/titanium_mobile/pull/8117\r\n- 5_4_X: https://github.com/appcelerator/titanium_mobile/pull/8118", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-08T16:27:52.000+0000", "updated": "2016-07-08T16:38:42.000+0000" }, { "id": "390331", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~jlongton] Could you please re-test with the updated docs to make sure you're able to get the local notifications, once confirmed we can resolve and close the ticket :). ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-11T16:58:11.000+0000", "updated": "2016-07-11T16:58:24.000+0000" }, { "id": "390536", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Many many silly mistakes in that PR. First of all, use this demo-code:\r\n{code:javascript}\r\n\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : \"#fff\"\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title : \"Schedule notification\"\r\n});\r\n\r\nTi.App.iOS.addEventListener('notification', function(e) {\r\n alert(\"Received!\");\r\n});\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n if (!Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS)) {\r\n Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {\r\n if (!e.success) {\r\n Ti.API.error(\"No permissions granted!\");\r\n return;\r\n }\r\n \r\n scheduleNotification();\r\n })\r\n } else {\r\n scheduleNotification();\r\n }\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n\r\nfunction scheduleNotification() {\r\n Ti.App.iOS.cancelAllLocalNotifications();\r\n Ti.App.iOS.registerUserNotificationSettings({\r\n 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 var notification = Ti.App.iOS.scheduleLocalNotification({\r\n alertTitle: \"Feature Test\",\r\n alertAction: \"update\",\r\n alertBody: \"New content available! Update now?\",\r\n badge: 12,\r\n userInfo: { \"url\":\"http://www.download.com/content/asset.json\"},\r\n region:{\r\n latitude: 52.672,\r\n longitude: 7.299,\r\n radius: 10000,\r\n triggersOnce: false,\r\n identifier: \"WTF\"\r\n }\r\n }); \r\n}\r\n{code}\r\n\r\nI also pushed changes to the master-PR, adding it to the backport as soon as it works on master.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-12T22:15:36.000+0000", "updated": "2016-07-12T22:15:36.000+0000" }, { "id": "390948", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Removing from review for 5.4.0 because of the {{region}} issue. I possibly fix it as part of the TIMOB-23527 effort. [~cng] fyi", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-18T21:25:25.000+0000", "updated": "2016-07-18T21:25:25.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }