{ "id": "172675", "key": "AC-6038", "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": "6", "description": "", "name": "Hold" }, "resolutiondate": "2018-12-23T22:29:58.000+0000", "created": "2018-11-28T01:55:42.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-02-14T23:46:49.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": "We are supposed to be replacing the use of `UIWebView` with `WKWebView` on iOS, but this is proving to be impossible for me as I cannot figure out how to load local resources such as images, JS or CSS files from the Resources directory or from the applicationDir or tempDir. \r\n\r\nI cannot find any evidence of this being possible.\r\n\r\nIf it is possible, can some working sample code please be provided. Otherwise could support for this please be added urgently as this is a major limitation.\r\n\r\n*Sample code*\r\n\r\nUsing a UIWebView the following code works:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar html = '';\r\n\r\nvar webview = Ti.UI.createWebView({\r\n html: html\r\n});\r\n\r\nwin.add(webview);\r\nwin.open();\r\n{code}\r\n\r\nNote that in `tiapp.xml` is set to false so that the image can be referenced.\r\n\r\nThe same code using WKWebView does not load the image. Changing the image src to use the native file path also does not work.", "attachment": [], "flagged": false, "summary": "iOS: Ti.WKWebView cannot load local files or images", "creator": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "subtasks": [], "reporter": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "environment": null, "comment": { "comments": [ { "id": "443975", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Matthew,\r\n\r\n In jira ticket TIMOB-26095, we have already made a [PR|https://github.com/appcelerator/titanium_mobile/pull/10169] for moving to WKWebView from UIWebView, which will go in 8.0.0.\r\n [This commit|https://github.com/appcelerator/titanium_mobile/pull/10169/commits/ea7bee7cb3f155d2df1b7f5de6b81da48f4ad3e8] is responsible for handling local file in TIUIWebView which is missing in Ti.WKWebView.\r\nWould you like to test your app with above PR. If it works I'll move this code in Ti.WKWebView as well. Thanks!\r\n ", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-28T06:46:07.000+0000", "updated": "2018-11-28T06:46:34.000+0000" }, { "id": "443984", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "Hi Vijay that is great news and I will certainly test out the PR tomorrow. Thanks for sharing the details.", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2018-11-28T09:03:08.000+0000", "updated": "2018-11-28T09:03:08.000+0000" }, { "id": "444011", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "Hi @vijaysingh I am currently using 7.5.0.GA and the changeset you pointed me is not synonomous as there have been other changes made to TiUIWebView.m in 8.0 outside of just that one changeset.\r\n\r\nSo instead I have switched to experimenting with SDK build 8.0.0.v20181030074154.\r\n\r\nIn testing this, my understanding is that 8.0 will continue to support calls to Ti.UI.createWebView - and it will be switching to use WKWebView under the hoods ... is that correct? So basically I should ignore the module version of WKWebView and just work with Ti.UI.createWebView and it will be taken care of under the hoods? \r\n\r\nI tracked down what looks like the updated docs around these changes [here|https://github.com/appcelerator/titanium_mobile/blob/3728533ad0938f86bab1780514afd7f5a47ed5c0/apidoc/Titanium/UI/WebView.yml].\r\n\r\nAlso is there an expected timeframe for a 8.0 RC or GA? i.e. is there a target before the end of the year? Or should I not count on this?\r\n\r\nThanks for your help.", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2018-11-28T22:02:52.000+0000", "updated": "2018-11-28T23:02:32.000+0000" }, { "id": "444027", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~mdelmarter] Yes. From sdk 8.0.0+ Ti.UI.createWebView will internally use WKWebView apis instead UIWebView. And it is 100% backward compatible. So you do not have to change anything in your code, if you are using TiUiWebView. \r\nI do not have any release date with me. I guess it can be in next 2 weeks. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-29T03:41:15.000+0000", "updated": "2018-11-29T03:41:39.000+0000" }, { "id": "444053", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "@vijay Thanks so much for your clear explanation that is really helpful.", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2018-11-29T18:12:12.000+0000", "updated": "2018-11-29T18:12:48.000+0000" }, { "id": "446084", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "Just FYI I have been trying to experiment with the Ti SDK 8.0 to verify that this code should work, but it does not seem to for me. I last used build 8.0.0.v20190130052111.\r\n\r\nI am anxiously waiting for 8.0 and verification of this code working. I am building a new app that heavily uses WebView and I am greatly concerned about the change to WKWebView and the amount of things that may break.", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2019-02-14T23:46:29.000+0000", "updated": "2019-02-14T23:46:49.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }