{ "id": "173488", "key": "AC-6221", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-05-11T00:20:31.000+0000", "created": "2019-04-19T23:10:52.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-11T00:20:31.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": "When I run sdk 8. My web view loads but the display is super small. Any js events inside the html don’t work properly. Is there any way to get the 7.4.2 functionality back ", "attachment": [], "flagged": false, "summary": "Local Html based web view not working on sdk 8", "creator": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "447804", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The old iOS native {{UIWebView}} has been deprecated by Apple. As of Titanium 8.0.0, the {{Ti.UI.WebView}} has been re-implemented to use Apple's {{WKWebView}} which does have some breaking changes on Apple's end.\r\n\r\nFor your local HTML files, you'll need to add the following {{}} tag so that it'll scale the contents like how it worked before.\r\n{code:html}\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t

Hello World

\r\n\t\r\n\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-20T01:02:13.000+0000", "updated": "2019-04-20T01:02:13.000+0000" }, { "id": "447805", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also, I've tested iOS' {{WebView}} with a locally loaded HTML string as shown below. The below code tests interop between the HTML JavaScript and the Titanium JavaScript via {{Ti.App.fireEvent()}} and the new async {{WebView.evalJS()}} feature. It works fine.\r\n\r\n{code:javascript}\r\nvar htmlText =\r\n\t\t'' +\r\n\t\t'' +\r\n\t\t'\t' +\r\n\t\t'\t\t' +\r\n\t\t'\t' +\r\n\t\t'\t' +\r\n\t\t'\t\t

HTML JavaScript Interop Test

' +\r\n\t\t'\t\t

' +\r\n\t\t'\t' +\r\n\t\t'\t' +\r\n\t\t'';\r\n\r\nvar window = Ti.UI.createWindow();\r\nvar webView = Ti.UI.createWebView({\r\n\thtml: htmlText,\r\n});\r\nwindow.add(webView);\r\nwindow.open();\r\n\r\nvar timerId;\r\nvar timerCount;\r\nfunction updateWebView() {\r\n\ttimerCount = 5;\r\n\tfunction onUpdate() {\r\n\t\tif (timerCount > 0) {\r\n\t\t\tTi.API.info(\"@@@ Calling evalJS()\");\r\n\t\t\twebView.evalJS(\"updateLabelTo('Reload in: \" + timerCount + \"')\", function() {});\r\n//webView.evalJS(\"updateLabelTo('Reload in: \" + timerCount + \"')\");\r\n\t\t\ttimerCount--;\r\n\t\t} else {\r\n\t\t\tTi.API.info(\"@@@ Reloading WebView\");\r\n\t\t\tclearInterval(timerId);\r\n\t\t\ttimerId = null;\r\n\t\t\ttimerCount = 5;\r\n\t\t\twebView.html = htmlText;\r\n\t\t}\r\n\t}\r\n\ttimerId = setInterval(function(e) {\r\n\t\tonUpdate();\r\n\t}, 1000);\r\n\tonUpdate();\r\n}\r\n\r\nvar useHtmlLoadedEvent = true;\r\nif (useHtmlLoadedEvent) {\r\n\tTi.App.addEventListener(\"app:htmlLoaded\", function(e) {\r\n\t\tTi.API.info(\"@@@ Received event 'htmlLoaded'\");\r\n\t\tif (e.isRequestingStartTimer) {\r\n\t\t\tupdateWebView();\r\n\t\t}\r\n\t});\r\n} else {\r\n\twebView.addEventListener(\"load\", function(e) {\r\n\t\tTi.API.info(\"@@@ Received WebView event 'load'\");\r\n\t\tupdateWebView();\r\n\t});\r\n}\r\n\r\nTi.App.addEventListener(\"app:htmlRequestingShowToast\", function(e) {\r\n\tif (Ti.App.Android || Ti.App.Windows) {\r\n\t\tif (e.message) {\r\n\t\t\tTi.UI.createNotification({\r\n\t\t\t\tmessage: e.message,\r\n\t\t\t\tduration: Ti.UI.NOTIFICATION_DURATION_SHORT,\r\n\t\t\t}).show();\r\n\t\t}\r\n\t}\r\n});\r\n{code}\r\n\r\nCan you give us an example of what's not working for you please? Thanks.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-20T01:04:58.000+0000", "updated": "2019-04-20T01:10:38.000+0000" }, { "id": "447806", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "My above test was missing a {{Ti.App.addEventListener()}} in the HTML's JavaScript. So, I also ran the below which exercises this as well. This too works fine for me in iOS with Titanium 8.0.0.\r\n{code:javascript}\r\nvar htmlText =\r\n\t\t'' +\r\n\t\t'' +\r\n\t\t'\t' +\r\n\t\t'\t\t' +\r\n\t\t'\t' +\r\n\t\t'\t' +\r\n\t\t'\t\t

HTML Fire Event Test

' +\r\n\t\t'\t\t

' +\r\n\t\t'\t' +\r\n\t\t'\t' +\r\n\t\t'';\r\n\r\nvar window = Ti.UI.createWindow();\r\nvar webView = Ti.UI.createWebView({\r\n\thtml: htmlText,\r\n});\r\nwindow.add(webView);\r\nwindow.open();\r\n\r\nvar count = 1;\r\nsetInterval(function(e) {\r\n\tTi.App.fireEvent('app:webViewEval', {\r\n\t\tjavaScriptString: 'document.getElementById(\"label\").innerHTML = \"Counter: ' + count + '\"',\r\n\t});\r\n\tcount++;\r\n}, 1000);\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-20T01:13:49.000+0000", "updated": "2019-04-20T01:13:49.000+0000" }, { "id": "447917", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tested the sample code by Joshus above of local HTML with SDK 8.0.0.GA in iOS. Works fine on my end. Please share sample code can reproduce the issue. We will test it on our end. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-04-23T18:58:21.000+0000", "updated": "2019-04-23T18:58:21.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }