{ "id": "147475", "key": "TIMOB-19624", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-01-20T14:24:11.000+0000", "created": "2015-05-02T22:33:00.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-06T17:41:07.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": "I got the idea that when the app is running for a few days, the local notifications stop working.\r\nAdded some logging to app.js to test this:\r\n\t\r\n\r\n{noformat}\r\nTi.App.iOS.addEventListener('notification',function(e) {\r\n Ti.API.info(\"APP local notification received: \"+JSON.stringify(e));\r\n});\r\n{noformat}\r\n\r\n\r\nChanged /Library/Application Support/Titanium/mobilesdk/osx/3.5.1.GA/iphone/Classes/TiApp.m to add some logging in the application delegate:\r\n\r\n\r\n{noformat}\r\n- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification\r\n{\r\n DebugLog(@\"[INFO] TiApp Didreceivelocalnotification\"); \r\n RELEASE_TO_NIL(localNotification);\r\n localNotification = [[[self class] dictionaryWithLocalNotification:notification] retain];\r\n [[NSNotificationCenter defaultCenter] postNotificationName:kTiLocalNotification object:localNotification userInfo:nil];\r\n}\r\n{noformat}\r\n\r\n\r\n\r\nIn the beginning when the app is freshly started everything looks ok:\r\n\r\n\r\n{noformat}\r\nMay 1 00:29:22 iPhone inbeacon[3427] : [INFO] TiApp Didreceivelocalnotification\r\nMay 1 00:29:22 iPhone inbeacon[3427] : [INFO] local notification received: {\"category\":null,\"badge\":0,\"alertAction\":\"toet\",\"timezone\":\"Europe/Amsterdam\",\"alertBody\":\"toet toet nederlands\",\"sound\":\"UILocalNotificationDefaultSoundName\",\"alertLaunchImage\":null,\"date\":\"2015-05-01T10:42:42.825Z\",\"userInfo\":{\"inbeacon\":true,\"tid\":\"305\",\"id\":38},\"identifier\":null,\"bubbles\":true,\"type\":\"notification\",\"source\":{},\"cancelBubble\":false}\r\nMay 1 00:29:22 iPhone inbeacon[3427] : [INFO] APP local notification received: {\"category\":null,\"badge\":0,\"alertAction\":\"toet\",\"timezone\":\"Europe/Amsterdam\",\"alertBody\":\"toet toet nederlands\",\"sound\":\"UILocalNotificationDefaultSoundName\",\"alertLaunchImage\":null,\"date\":\"2015-05-01T10:42:42.825Z\",\"userInfo\":{\"inbeacon\":true,\"tid\":\"305\",\"id\":38},\"identifier\":null,\"bubbles\":true,\"type\":\"notification\",\"source\":{},\"cancelBubble\":false}\r\n\r\n{noformat}\r\n\r\n\r\nBut if I let the app run for a few days, it stops working:\r\n\r\n\r\n{noformat}\r\nMay 3 00:14:48 iPhone inbeacon[1587] : [INFO] TiApp Didreceivelocalnotification\r\n*<--- missing the notification event here --->*\r\nMay 3 00:14:49 iPhone inbeacon[1587] : [DEBUG] Firing app event: resumed\r\nMay 3 00:14:49 iPhone inbeacon[1587] : [INFO] app has resumed from the background\r\nMay 3 00:14:49 iPhone inbeacon[1587] : [INFO] device/sync with http://api.inbeacon.nl\r\nMay 3 00:14:50 iPhone inbeacon[1587] : [INFO] device/sync: No refresh -> already synced to version 175\r\n\r\n{noformat}\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS event 'notification' not called any more when the app runs a couple of days", "creator": { "name": "rvwoens", "key": "rvwoens", "displayName": "Ronald van Woensel", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rvwoens", "key": "rvwoens", "displayName": "Ronald van Woensel", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 8.3 \r\niPhone 6\r\nTi 3.5.1 GA\r\n", "closedSprints": [ { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433414", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This is fixed since a while. We refactored the way notifications are handled internally to ensure they get queued on app-launch.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-20T14:24:11.000+0000", "updated": "2018-01-20T14:24:11.000+0000" }, { "id": "439982", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as a duplicate. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:41:07.000+0000", "updated": "2018-08-06T17:41:07.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }