{ "id": "170604", "key": "MOD-2379", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20078", "name": "Ti.URLSession 2.2.0", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-01T20:15:00.000+0000", "created": "2017-12-12T06:45:05.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:49:36.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": "14542", "name": "UrlSession" } ], "description": "This is an Enterprise customer requirement. The original scenario is as below:\r\n\r\nWe have a requirement where we need to upload a document to the service along with some data like document ID , document Name, document Category. When we have gone through the ti.URLSession module we have seen the methods like uploadTask where we are only able to pass the input as blob/image but not the additional information as mentioned above. \r\n\r\nIn the native iOS implementation we have seen the methods like dataTask and did not find the equivalent API call in Titanium module. Can you please provide a solution for this scenario or can expose the equivalent API to dataTask which is available in native iOS.\r\n", "attachment": [], "flagged": false, "summary": "Ti.URLSession module: expose dataTask equivalent API which is available in native iOS.", "creator": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "environment": null, "closedSprints": [ { "id": 997, "state": "closed", "name": "2018 Sprint 03 SDK", "startDate": "2018-01-28T16:23:12.178Z", "endDate": "2018-02-11T16:23:00.000Z", "completeDate": "2018-02-12T04:22:49.354Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "432118", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've done a [pull request|https://github.com/appcelerator-modules/ti.urlsession/pull/13] to support this last week. Does it resolve the request? If not, what additional API's should be exposed?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-12-13T21:33:12.000+0000", "updated": "2017-12-13T21:33:12.000+0000" }, { "id": "432514", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "[~hknoechel]\r\nIt PR looks good to me. Will forward customer the pre-release see if it fits customer's request.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2017-12-22T01:37:04.000+0000", "updated": "2017-12-22T01:37:04.000+0000" }, { "id": "433458", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~hknoechel] Is there any update here?", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-01-22T11:03:46.000+0000", "updated": "2018-01-22T11:03:46.000+0000" }, { "id": "433957", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just merged the PR and did some additional changes, so the {{sessioncompleted}} event actually gets called. The new release (2.2.0) can be found on the [Github page|https://github.com/appcelerator-modules/ti.urlsession/releases/tag/v2.2.0]. \r\n\r\nFull example:\r\n{code:js}\r\nvar URLSession = require('com.appcelerator.urlSession');\r\n\r\nvar sessionConfig = URLSession.createSessionConfiguration({\r\n identifier: 'com.test.test2'\r\n});\r\n\r\nvar session = URLSession.createSession({\r\n configuration: sessionConfig\r\n});\r\n\r\nvar window = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n title: 'Ti.URLSession'\r\n});\r\n\r\nvar nav = Ti.UI.iOS.createNavigationWindow({\r\n window: window\r\n});\r\n\r\nvar triggerButton = Titanium.UI.createButton({\r\n title: 'Start Data Task'\r\n});\r\n\r\ntriggerButton.addEventListener('click', function() {\r\n\r\n var taskIdentifier = session.dataTask({\r\n url: 'http://some-url.io',\r\n type: \"POST\",\r\n requestHeaders: {\r\n 'Content-Type': 'application/json'\r\n },\r\n data: {\r\n id: 123,\r\n category: \"category-456\"\r\n }\r\n });\r\n\r\n Ti.API.info('Starting data task with task identifier: ' + taskIdentifier);\r\n});\r\n\r\nwindow.add(triggerButton);\r\nnav.open();\r\n\r\n// Called when the data task completes\r\nTi.App.iOS.addEventListener('sessioncompleted', function(event) {\r\n alert('Session completed');\r\n Ti.API.info(JSON.stringify(event));\r\n});\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-01T20:15:00.000+0000", "updated": "2018-02-01T20:15:00.000+0000" }, { "id": "440244", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:36.000+0000", "updated": "2018-08-06T17:49:36.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }