{ "id": "173928", "key": "TIMOB-27372", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": null, "resolutiondate": null, "created": "2019-07-23T08:58:33.000+0000", "priority": null, "labels": [ "applicationDataDirectory", "engSchedule", "iOS", "webview" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" }, { "id": "20827", "name": "Release 8.2.0", "archived": false, "released": true, "releaseDate": "2019-09-19" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-02-27T12:38:30.000+0000", "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" } }, "components": [], "description": "On iPhone device (iOS 12.3.1) the image file is not getting loaded into webview from iPhone storage (applicationDataDirectory). It works on simulator 12.1\r\n\r\nplease check the attached sample test case", "attachment": [ { "id": "66780", "filename": "Resources.zip", "author": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-23T08:56:48.000+0000", "size": 84316, "mimeType": "application/zip" }, { "id": "66802", "filename": "Resources2.zip", "author": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-05T10:19:19.000+0000", "size": 35825, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS : image file not loading into the webview from iPhone storage", "creator": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.4\r\n npm Version = 5.6.0\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 8.0.2.GA\r\n SDK Path = /Users/infogrid/Library/Application Support/Titanium/mobilesdk/osx/8.0.2.GA\r\n Target Platform = iphone", "comment": { "comments": [ { "id": "450013", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~jignesh.igp] It looks duplicate of TIMOB-27159. Can you verify once with [PR|https://github.com/appcelerator/titanium_mobile/pull/10976].", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-23T16:21:13.000+0000", "updated": "2019-07-23T16:21:13.000+0000" }, { "id": "450033", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "It is not recommended to have local HTML and resource files in different folders. The {{assetsDirectory}} option introduced in TIMOB-27159 probably could solve this issue but you can avoid it in the first place by just having everything in the same directory.\r\n\r\nFor example, copy the HTML/JS to {{Ti.Filesystem.applicationDataDirectory}} as well and change the {{src}} property in your HTML file to the correct relative path.\r\n\r\nThe directory structure should look something like this based on your provided test case:\r\n\r\n{code}\r\n.\r\n├── index.html\r\n├── index.js\r\n├── jquery-1.8.3.js\r\n├── downloaded_images\r\n│ └── test.jpg\r\n│ └── ...\r\n└── ...\r\n{code}\r\n\r\nThen you can easily reference the images via {{downloaded_images/test.jpg}}.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-07-24T12:45:42.000+0000", "updated": "2019-07-24T12:45:42.000+0000" }, { "id": "450052", "author": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks! Jan Vennemann\r\n\r\nOur actual problem is, we have e-learning base app that have dynamic content (css , images ,js) need to present in webview which we are downloading from server and storing it into the iPhone storage (Ti.Filesystem.applicationDataDirectory) and loading it to webview. Where for webview presentation & layout we have static files (index.html, css , images , js) that we kept it under app Resource directory\r\n\r\nso the webview uses both directory.\r\n\r\nThe storage directory access in webview is working fine with Titanium SDK 7.4.1 on iPhone Device (Latest iOS 12.3.1 version) but not from Titanium SDK 8.X.X updates and onwards\r\n", "updateAuthor": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-25T09:02:49.000+0000", "updated": "2019-07-25T09:24:33.000+0000" }, { "id": "450181", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, unfortunately that is a breaking change in 8.0.0 when we moved to WKWebView internally. \r\n\r\nThe workaround from my previous comment should also be easily implemented for your use case. Just copy the relevant files from the resources directory to the data directory on first app launch or whenever you update the app. Then you will have everything in the same place and do not run into these limitations.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-07-31T14:19:55.000+0000", "updated": "2019-07-31T14:19:55.000+0000" }, { "id": "450265", "author": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks\r\n\r\nas you suggested. We have tested the workaround to place everything in one place ( html, image) but still the file is not loading into webview from applicationDataDirectory (Device)\r\n\r\nPlease find the attached test example (Resources2.zip [^Resources2.zip] )", "updateAuthor": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-05T10:19:44.000+0000", "updated": "2019-08-05T10:19:44.000+0000" }, { "id": "450457", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jignesh.igp], thanks for providing an example. The {{setHtml}} methods still seems to have some issues with resolving relative paths.\r\n\r\n[~vijaysingh], can you take a look at this? Using {{setHtml}} with the {{baseURL}} option fails to load local resources even when using the fix from TIMOB-27159.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-08-13T18:58:11.000+0000", "updated": "2019-08-13T18:58:11.000+0000" }, { "id": "454460", "author": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello. \r\n\r\nis there any work-around to fix the issue ? i am not able to load local files JGP , JS ..etc under the webview from Phone Storage applicationDataDirectory\r\n\r\nchecked on Release 8.3.1 but it's not working.", "updateAuthor": { "name": "jignesh.igp", "key": "jignesh.igp", "displayName": "Jignesh Kasundra", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-27T12:38:30.000+0000", "updated": "2020-02-27T12:38:30.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }