{ "id": "159530", "key": "TIMOB-23205", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-18T22:43:34.000+0000", "created": "2016-04-13T00:31:34.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [ { "id": "51419", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159706", "key": "TIMOB-23241", "fields": { "summary": "Windows: logging from native module doesn't work", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51322", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "148259", "key": "TIMOB-18952", "fields": { "summary": "Windows: Implement support for background services (or tiled applications)", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-07-07T15:17:23.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Relates to TIMOB-18952\r\n\r\nAfter lots of investigation & trial, I almost came up with a conclusion that it is _not_ possible to enable JavaScript/Ti context in background service. It's obviously too much to have two JavaScript/Ti instances at once (foreground & background), and the platform does not allow it. It's too much enough to screw up things (app freeze / device forced to restart, etc).\r\n\r\nWe have one more choice so far then: which is\r\n\r\n*Implement background trigger extension by native module (C++)*.\r\n\r\nThis should enable native module to react when background trigger is fired. Because it's a native module, you should be able to do anything you need. This means you need to code with C++ instead of JS (too bad) but at least we have last resort to implement custom logic.", "attachment": [], "flagged": false, "summary": "Windows: Background service extension by native module (C++/CX).", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "382583", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "If this direction is working we need to access the following APIs and I have the following questions how to handle, the solution must be able to \"communicate\" with these Ti context things even if we do not write the code in JS. Also please note how I need to bring into the callback other APIs and classes to be able to extend the callback with notifications and encryption....\r\n\r\n\r\nQ: \r\n\r\nHow do we transfer data (Ti.Platform.Properties) to the main app, and back? We use 4 critical flags saved into this API to take decisions in the background as well as save the last known location to the front app...\r\n\r\nCan we use the fire event API?\r\n\r\nHow do we update a collection after receiving HTTP response?\r\n\r\nCurrently I am trying hard to enable the native encryption libraries in a module to support the encryption HTTP post and get commands, we have to make one POST and one GET with encrypted data.\r\n\r\nAlso we have to be able to create notifications and/or receive push notifications in the app..\r\n\r\nThere might be more that I oversee right now but basically this is it..", "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-13T11:30:14.000+0000", "updated": "2016-04-13T11:30:14.000+0000" }, { "id": "382589", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "As I try to get things running in the module, can I ask you to verify if this log is working for you with the Emulator? Mine is not and I desperately need a way to debug the native code in the module..\r\n\r\nTITANIUM_LOG_DEBUG(\"Extendwindows:: called genKey()\");\r\n\r\n??\r\n\r\nthanks ", "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-13T13:18:42.000+0000", "updated": "2016-04-13T13:18:42.000+0000" }, { "id": "382590", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "BTW I have a module we could use, if you need to have context, to use as template for such a native callback... I have to aim for collect location, encrypt data and send to server at the moment, later I will have to get http from server and create notification... FYI", "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-13T13:19:59.000+0000", "updated": "2016-04-13T13:19:59.000+0000" }, { "id": "382687", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FYI I'm updating [module template|https://github.com/appcelerator/titanium_mobile_windows/blob/master/templates/module/default/template/windows/src/%7B%7BmoduleIdAsIdentifier%7D%7D.cpp.ejs#L49] and [background task|https://github.com/infosia/titanium_mobile_windows/blob/TIMOB-23205-PR/Source/Ti/src/App/BackgroundService.cpp#L24] to show examples on HAL/TitaniumKit API.\r\n\r\nFor the debug log, I guess it's because module is built with release mode ... I'll check.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-14T05:40:24.000+0000", "updated": "2016-04-14T05:40:24.000+0000" }, { "id": "382693", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, not sure what it means, is there anything I can test, running a native background code that actually i.e. updates the count parameter so I can see if it runs continuously?", "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-14T07:23:47.000+0000", "updated": "2016-04-14T07:23:47.000+0000" }, { "id": "382716", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Yes, and it is a good example of how to implement background tasks. It's not merged yet but will be soon. Note that Titanium background task class uses very standard WinRT [IBackgroundTask|https://msdn.microsoft.com/library/windows/apps/br224794] interface. It means you should be able to actually create your backgroudn task as stand-alone Windows Phone project using Visual Studio, and once you finishes the test you can just copy/paste your logic to the module. I think it's the easiest way to debug it. FYI I found official sample code of WinRT background task API: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BackgroundTask (Take a look at cpp sample because Titanium is using C+\\+/CX )", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-14T09:15:41.000+0000", "updated": "2016-04-14T09:15:41.000+0000" }, { "id": "382795", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/619", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-15T04:11:23.000+0000", "updated": "2016-04-15T04:11:23.000+0000" }, { "id": "390042", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nWindows 10 Pro\r\nTi SDK: 5.4.0.v20160705213725\r\nAppc NPM: 4.2.7-2 \r\nAppc CLI: 5.4.0-26\r\nAppc Studio: 4.7.0.201606220541\r\nLumia 930: 10.0\r\nLumia 520 : 8.1\r\n\r\nBy creating a module, and following https://wiki.appcelerator.org/display/guides2/Windows+Background+Service+Quick+Start a user can create a background task with custom logic that will be triggered by a timer.\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-07-07T15:17:18.000+0000", "updated": "2016-07-07T15:17:18.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }