{ "id": "163403", "key": "AC-4500", "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": "2016-09-24T16:45:19.000+0000", "created": "2016-09-23T08:54:52.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-09-26T11:41:25.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": [], "description": "Create an HTTP request, with a properly server method to accept the request, and upload an image in method send. \r\nWhen try to call onload method of HTTP request, it works for Android, but not for iOS.\r\nSo, if you need to do some action after server response, it's impossibile to do it on iOs. \r\n", "attachment": [], "flagged": false, "summary": "iOs: onload after upload image - Ti.Network.createHTTPClient ", "creator": { "name": "asalini", "key": "asalini", "displayName": "Andrea Salini", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "asalini", "key": "asalini", "displayName": "Andrea Salini", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "397077", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, We need a sample test code and your test environment where the issue is regeneratable. Send us these. We will look into it. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-09-23T19:07:43.000+0000", "updated": "2016-09-23T19:07:43.000+0000" }, { "id": "397124", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Make sure you call {{onload}} on creation, so as part of {{Ti.Network.createHTTPClient()}}. I'm pretty sure it works, since there are production apps out there that use this very common feature.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-23T22:25:12.000+0000", "updated": "2016-09-23T22:25:12.000+0000" }, { "id": "397157", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We need more info in order to test and prioritize this properly. Please attach at least:\r\n- Full environment (Titanium SDK-version, iOS version)\r\n- Full trace-log \r\n- Example-code (that fit's into a single-executive app.js file)", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-24T16:45:19.000+0000", "updated": "2016-09-24T16:45:19.000+0000" }, { "id": "397229", "author": { "name": "asalini", "key": "asalini", "displayName": "Andrea Salini", "active": true, "timeZone": "America/Los_Angeles" }, "body": "//The first xhr call is about a backend method that create an object related with the files i need to save\t\t\t\r\n\r\n\tvar xhr = Ti.Network.createHTTPClient({\r\n\t\t\t\t\tonload: function() {\r\n\t\t\t\t\tactivityIndicator.hide();\r\n\t\t\t\t\t\tvar risposta = JSON.parse(this.responseText);\r\n //variable foto is my array of images\r\n\t\t\t\t\t\tif (foto.length>0){\r\n\t\t\t\t\t\t\tfor(var i = 0; i < foto.length; i++){\r\n\t\t\t\t\t\t\t\tvar xhr1 = Ti.Network.createHTTPClient({onload: function() {\r\n alert('check enter onload');\r\n\t\t\t\t\t\t\t\t\tif(i==(foto.length-1)){\r\n\t\t\t\t\t\t\t\t\t\tactivityIndicator.hide();\r\n\t\t\t\t\t\t\t\t\t\tTi.include('/attivit/lista.js');\r\n\t\t\t\t\t\t\t\t\t\twin1 = lista(activityIndicator);\r\n\t\t\t\t\t\t\t\t\t\twin_pranzo.add(win1);}\r\n alert('check stop');\r\n\t\t\t\t\t\t\t\t\t}});\r\n \r\n //url is the backend method to upload the foto. It has some information about the object created in xhr method, so it's similar to 'https://theurl.com/method?object=risposta' where risposta is var risposta = JSON.parse(this.responseText); (see up) received from xhr \r\n\t\t\t\t\t\t\t\t\txhr1.open('POST',url);\r\n\t\t\t\t\t\t\t\t\txhr1.send({multifile: foto[i]});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \t{\r\n\t\t\t\t\t\tTi.include('/attivit/lista.js');\r\n\t\t\t\t\t\t\twin1 = lista(activityIndicator);\r\n\t\t\t\t\t\t\twin_pranzo.add(win1);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\nIn this way android enters in onload method and xhr and xhr1 without problems, so i can see both alert. \r\nFor iOs it's not possible, and also the first alert with 'check enter onload' is not displayed. \r\nLog don't display anything about this problem, so it's not useful to attach. \r\nSDK version: 5.1.2, 5.4.0, 5.5.0 (i have the same problem in all those versions)\r\niOs version: 9 and 10 (i have the same problem in all those versions) ", "updateAuthor": { "name": "asalini", "key": "asalini", "displayName": "Andrea Salini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-26T11:41:25.000+0000", "updated": "2016-09-26T11:41:25.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }