{ "id": "164381", "key": "TIMOB-24101", "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": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" }, { "id": "19101", "name": "Hyperloop 2.1.0", "archived": false, "released": true, "releaseDate": "2017-04-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-04-11T13:09:08.000+0000", "created": "2016-11-04T06:38:01.000+0000", "epic": { "id": 162541, "key": "TIMOB-23765", "name": "Hyperloop for Windows", "summary": "Windows: Direct API Access not working ", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-04-21T17:26:01.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": "Add ability to use third-party dependencies in your Hyperloop enabled project. This may be done by putting WinMD({{.winmd}}) or DLL ({{.dll}}) on certain place on your project.\r\n\r\n*Steps to test*\r\n\r\n1. Create Windows Runtime Component\r\n\r\nCreate Windows Runtime Component named {{WindowsRuntimeComponent1}} from Visual Studio. Compile it and you should get {{WindowsRuntimeComponent1.winmd}} somewhere under in your Visual Studio project folder. You might want to use [^WindowsRuntimeComponent1.winmd] if you want to skip this step. \r\n\r\n{code:title=Test.cs}\r\nusing System;\r\n\r\nnamespace WindowsRuntimeComponent1\r\n{\r\n public sealed class Test\r\n {\r\n public int SampleNumber { get; set; }\r\n\r\n public static string SayHello(string str)\r\n {\r\n return String.Format(\"Hello, {0}!\", str);\r\n }\r\n\r\n public string sayNumber()\r\n {\r\n return String.Format(\"SampleNumber is {0}.\", SampleNumber);\r\n }\r\n }\r\n}\r\n{code}\r\n\r\n2. Copy your {{WindowsRuntimeComponent1.winmd}} file into {{lib/windows/win10/x86/}} folder under your Titanium app project folder.\r\n\r\n{code:javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'green' }),\r\n Test = require('WindowsRuntimeComponent1.Test'),\r\n test = new Test();\r\n\r\nwin.addEventListener('open', function() {\r\n alert(test.SayHello('World!'));\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\n3. Place {{appc.windows.js}} directly under your Titanium project folder. Make sure it contains names of your Windows Runtime component under {{hyperloop.windows.thirdparty}} key. It should look like below.\r\n\r\n{code:javascript|title=appc.windows.js}\r\n/**\r\n * Hyperloop configuration\r\n */\r\nmodule.exports = {\r\n\ttype: 'app',\r\n\tgroup: 'titanium',\r\n\tdependencies: {},\r\n\thyperloop: {\r\n\t\twindows:\r\n\t\t{\r\n\t\t\t/**\r\n\t\t\t * Optionally, you can bring in third-party or first-party Windows Runtime components.\r\n\t\t\t * The 'key' is the root namespace of the component that will be used in the require.\r\n\t\t\t * There's no values for now but we reserve them for future release.\r\n\t\t\t *\r\n\t\t\t * Place the library files into the lib/windows/(phone|store|win10)/(x86|ARM)/ folder under your app project.\r\n\t\t\t * Hyperloop will pick up the winmd files and will generate necessary bindings and include the winmd in your app. \r\n\t\t\t */\r\n\t\t\tthirdparty: {\r\n\t\t\t\t'WindowsRuntimeComponent1': {}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n{code}\r\n4. Make sure to enable hyperloop, and then run it using {{appc run -p windows --wp-sdk 10.0 --target ws-local -l trace}}.\r\n5. Then you should see \"Hello, World!!\" dialog box in your Titanium app.", "attachment": [ { "id": "61987", "filename": "WindowsRuntimeComponent1.winmd", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-04-07T04:59:59.000+0000", "size": 6656, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "Windows: Ability to use 3rd-party native classes", "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": 871, "state": "closed", "name": "2017 Sprint 08 SDK", "startDate": "2017-04-10T15:40:31.217Z", "endDate": "2017-04-24T15:40:00.000Z", "completeDate": "2017-04-23T21:46:37.098Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "417008", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/967", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-04-07T05:03:27.000+0000", "updated": "2017-04-07T05:03:27.000+0000" }, { "id": "417846", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Validated fix with this environment: \r\nNode Version: 6.10.1 \r\nNPM Version: 4.4.4 \r\nAppc CLI: 6.2.0 \r\nAppc CLI NPM: 4.2.9 \r\nTitanium SDK version: 6.1.0.v20170421082637\r\nAppcelerator Studio, build: 4.8.1.201612050850 \r\nOS: Windows 10.0.14393 \r\nTargets: Windows 8.1 & 10 Devices. Windows 10 Emulator \r\nHyperloop 2.1.0\r\n\r\nFR passed with above environment, and fixes were verified in the SDK version noted above.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-21T17:25:19.000+0000", "updated": "2017-04-21T17:25:19.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }