{ "id": "82554", "key": "TIMOB-6923", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-02T22:04:11.000+0000", "created": "2011-11-08T16:14:30.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T22:04:11.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": "h2. Problem\r\n\r\n* [Titanium.App.iOS.LocalNotification|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.App.iOS.LocalNotification-object] notifications scheduled from a background process last for exactly 40 seconds\r\n* Firing an event from a background process causing app.js to schedule a local notification does not solve the problem. In this case the notification lasts for exactly 30 seconds\r\n\r\nNote that Local notifications scheduled directly from {{app.js}} work as expected (last forever)\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.Geolocation.purpose = 'Geolocation';\r\nTi.App.service = Ti.App.iOS.registerBackgroundService({url: 'service.js'});\r\n{code} \r\n\r\n{code:lang=javascript|title=service.js}\r\nvar fired = false;\r\n\r\nfunction location(e) {\r\n if (e.error) { return false; };\r\n if (fired === false) {\r\n fired = true;\r\n var notification = Ti.App.iOS.scheduleLocalNotification({\r\n alertBody:\"Bananas was put in background\",\r\n alertAction:\"Re-Launch!\",\r\n userInfo:{\"hello\":\"world\"},\r\n date:new Date(new Date().getTime() + 1000) // 1 second after backgrounding\r\n });\r\n Ti.Geolocation.removeEventListener('location', location);\r\n };\r\n return;\r\n};\r\n\r\nTi.Geolocation.addEventListener('location', location);\r\nTi.App.service.addEventListener('stop', function() {\r\n Ti.Geolocation.removeEventListener('location', location);\r\n});\r\n{code} \r\n\r\n\r\nh2. Discussions\r\n\r\nHelpdesk: [APP-564871|http://support.appcelerator.com/tickets/APP-564871]", "attachment": [], "flagged": false, "summary": "iOS: App.iOS - LocalNotification scheduled from a background process dismiss after 40 seconds", "creator": { "name": "jeevan", "key": "jeevan", "displayName": "Jeevan Takhar", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jeevan", "key": "jeevan", "displayName": "Jeevan Takhar", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* *SDK:* Titanium Mobile 1.8.0.1.v20111108235628-osx\r\n* *Platform:* iOS 5.0\r\n* *Device:* iPhone Simulator, iPhone 4S", "comment": { "comments": [ { "id": "177551", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thanks for raising this ticket.\r\n\r\nPlease check the environment field against the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist], and add any missing information.\r\n\r\nI will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project.\r\n\r\nCheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-12-29T05:28:31.000+0000", "updated": "2011-12-29T05:28:31.000+0000" }, { "id": "177552", "author": { "name": "jeevan", "key": "jeevan", "displayName": "Jeevan Takhar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've updated the field with relevant information.", "updateAuthor": { "name": "jeevan", "key": "jeevan", "displayName": "Jeevan Takhar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-29T05:31:45.000+0000", "updated": "2011-12-29T05:31:45.000+0000" }, { "id": "179031", "author": { "name": "gklka", "key": "gklka", "displayName": "Gruber Kristóf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think the main issue is this:\r\n\r\n\"Based on my understanding of the titanium source when you create a new notification they return a TiAppiOSLocalNotificationProxy....which you cannot really do anything with such as save it to a property or anything. However, as soon as the proxy loses scope and it gets cleared up the dealloc will cause the notification to be cancelled. This is one reason in the KitchenSink example the notifications are included in the background example, because with their implementation if you closed the app and still didn't have a variable holding on to it....it would cancel the notification. This is not a requirement in normal iOS but with the Titanium implementation you have to hold on to the variable.\"", "updateAuthor": { "name": "gklka", "key": "gklka", "displayName": "Gruber Kristóf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-12T05:02:39.000+0000", "updated": "2012-01-12T05:02:39.000+0000" }, { "id": "418923", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-02T22:04:11.000+0000", "updated": "2017-05-02T22:04:11.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }