{ "id": "173226", "key": "AC-6178", "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": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2019-05-11T00:23:20.000+0000", "created": "2019-03-23T03:54:16.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-11T00:23:20.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "\r\n \r\n UIBackgroundModes\r\n \r\n fetch\r\n \r\n \r\n\r\n\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\nTi.App.iOS.setMinimumBackgroundFetchInterval(1800);\r\n//app.performFetchWithCompletionHandler()\r\n\r\nTi.App.iOS.addEventListener(\"backgroundfetch\", function(e){\r\n\tvar fetchID = e.handlerId;\r\n Ti.App.iOS.scheduleLocalNotification({\r\n date: new Date(new Date().getTime()),\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 Ti.App.iOS.endBackgroundHandler(fetchID);\r\n});\r\n\r\nThe event never fires and the schedule notification never happend.", "attachment": [ { "id": "66335", "filename": "index.js", "author": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-23T08:06:22.000+0000", "size": 880, "mimeType": "text/javascript" }, { "id": "66336", "filename": "tiapp.xml", "author": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-23T08:07:01.000+0000", "size": 4019, "mimeType": "text/xml" } ], "flagged": false, "summary": "iOS background fetch is not working. ", "creator": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacBook Pro (Retina, 13-inch, Late 2013)\r\nMojave 10.14.3 (18D109)\r\nTitanium SDK: 8.0.0.GA", "comment": { "comments": [ { "id": "447101", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "\t\r\nThanks for reaching out! Are you experiencing this on iPhone device? It would be better if you can provide complete simple test case, your full environment details and detail console logs to reproduce the issue on our end.\r\n\r\n", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-23T05:29:26.000+0000", "updated": "2019-03-23T05:29:26.000+0000" }, { "id": "447102", "author": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "body": "i've attach the index.js and the tiapp.", "updateAuthor": { "name": "lau.yikonn", "key": "lau.yikonn", "displayName": "lau.yikonn", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-23T08:07:28.000+0000", "updated": "2019-03-23T08:07:28.000+0000" }, { "id": "447506", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~lau.yikonn],\r\nCan you please try the sample code from [Background fetch|https://wiki.appcelerator.org/display/guides2/iOS+Background+Services#iOSBackgroundServices-Backgroundfetch] section and let us know how it goes.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-04-07T11:26:28.000+0000", "updated": "2019-04-07T11:26:28.000+0000" }, { "id": "447553", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~lau.yikonn], Can you get back here? did you follow the above guide? let us know how things going. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-04-09T17:56:08.000+0000", "updated": "2019-04-09T17:56:08.000+0000" }, { "id": "447928", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nDid you find our last reply helpful for your progress? Let us know the updates from your end.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-04-24T09:19:40.000+0000", "updated": "2019-04-24T09:19:40.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }