{ "id": "173585", "key": "TIMOB-27056", "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": [ { "id": "20791", "name": "Release 8.0.2", "archived": false, "released": true, "releaseDate": "2019-06-18" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-06-04T22:27:08.000+0000", "created": "2019-05-02T18:36:04.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "WebView", "engSchedule", "html", "ios", "regression" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-06-04T22:27:08.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nThe {{Titanium}} object is undefined within a {{WebView}}'s HTML {{\\n' +\r\n\t\t'\\n';\r\n\r\nTi.App.addEventListener(\"app:requestLogMessage\", function(e) {\r\n\tTi.API.info(e.message);\r\n});\r\nTi.App.addEventListener(\"app:webViewReady\", function(e) {\r\n\tTi.App.fireEvent(\"app:signalHtml\", {});\r\n});\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{code}\r\n\r\n*Expected Result:*\r\nThe following should be logged. (You'll get the below with a 7.5.1 built app.)\r\n{code}\r\n[INFO] @@@ Logging via Ti.API.info() method.\r\n[INFO] @@@ Logging via Titanium.API.info() method.\r\n[INFO] @@@ Fired event via Ti.App.fireEvent() method\r\n[INFO] @@@ Fired event via Titanium.App.fireEvent() method\r\n[INFO] @@@ Received event via Ti.App.addEventListener() method.\r\n[INFO] @@@ Received event via Titanium.App.addEventListener() method.\r\n{code}\r\n\r\n*Actual Result:*\r\nOnly the 1st message gets logged in Titanium 8.0.0 or 8.0.1 because the script errors out when using the {{Titanium}} object. _(This is the bug.)_\r\n{code}\r\n[INFO] @@@ Logging via Ti.API.info() method.\r\n{code}\r\n\r\n*Recommended Solution:*\r\nAdd a {{var Titanium = Ti;}} to the code that gets injected into the WKWebView here...\r\n[TiUIWebView.m|https://github.com/appcelerator/titanium_mobile/blob/3d1569dededb35387b197a71317ffa3e7fb42ea8/iphone/Classes/TiUIWebView.m#L390]\r\n\r\n*Work-Around:*\r\nUse the {{Ti}} object instead of the {{Titanium}} object within the HTML's script.", "attachment": [], "flagged": false, "summary": "iOS: WebView HTML JS code can no longer access \"Titanium.\" API (but \"Ti.\" exists) as of 8.0.0", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1141, "state": "closed", "name": "2019 Sprint 12", "startDate": "2019-06-03T22:00:37.435Z", "endDate": "2019-06-14T22:00:00.000Z", "completeDate": "2019-06-15T03:44:20.826Z", "originBoardId": 114 }, { "id": 1136, "state": "closed", "name": "2019 Sprint 11", "startDate": "2019-05-18T17:39:52.830Z", "endDate": "2019-05-31T17:39:00.000Z", "completeDate": "2019-06-04T21:37:11.485Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "448178", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR(master) - https://github.com/appcelerator/titanium_mobile/pull/10877\r\nNote- Above PR is same as of ticket TIMOB-27055. Fixed both issue in same ticket in master.\r\n\r\nPR(8_0_X) - https://github.com/appcelerator/titanium_mobile/pull/10923", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-05-03T23:35:01.000+0000", "updated": "2019-05-29T22:06:06.000+0000" }, { "id": "448763", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting on jenkins", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-06-01T00:49:22.000+0000", "updated": "2019-06-01T00:49:22.000+0000" }, { "id": "448787", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR not merged for master. only merged on 8_0_X. waiting for resolving jenkin's failure", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-06-03T20:02:38.000+0000", "updated": "2019-06-03T20:02:38.000+0000" }, { "id": "448793", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, 8_0_X, 8_1_X", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-06-03T20:30:08.000+0000", "updated": "2019-06-03T20:30:08.000+0000" }, { "id": "448834", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on master SDK 8.2.0.v20190603133455, SDK 8.1.0.v20190603133458 and SDK 8.0.2.v20190603133031. logs shown in the console correctly.Closing\r\n{CODE}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 8.1.0.v20190603133458 ,8.2.0.v20190603133455 and 8.0.2.v20190603133031\r\n Device =Iphone 6s plus ios 12\r\nSimulator . = iphone xR ios 12\r\n{CODE}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-06-04T22:27:04.000+0000", "updated": "2019-06-04T22:27:04.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }