{ "id": "173827", "key": "TIMOB-27205", "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": "20827", "name": "Release 8.2.0", "archived": false, "released": true, "releaseDate": "2019-09-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-08-29T21:48:09.000+0000", "created": "2019-07-01T16:34:17.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "defect", "engSchedule" ], "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-08-29T21:48:09.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": "We have an integration with Plaid (https://plaid.com/) where we use a web view and capture redirects on the site.\r\n\r\nFrom their docs:\r\n“Communication between the WebView and your app is handled by HTTP redirects rather than client-side JavaScript callbacks. These redirects should be intercepted by your app.”\r\n\r\nWorking code:\r\n $.bankPlaidLinkWebView.addEventListener('beforeload', function(_e) {\r\n if (_e.url.indexOf(schemaOrString) > -1) {\r\n $.bankPlaidLinkWebView.stopLoading();\r\n handleCommand(_e.url);\r\n }\r\n });\r\n\r\nbeforeload triggers with an url the same as the one I sent. After that we should listen for an url that has \"plaidlink\" as the scheme.\r\n\r\nFrom the docs:\r\n\"All redirect URLs have the scheme plaidlink. The event type is communicated via the URL host and data is passed via the querystring. There are two supported events, connected and exit, which are documented below.\"\r\n\r\nThese redirects are never triggered and it always trigger my original url.\r\n\r\nThis is working on a published app but has stopped working since SDK 8.0.0.GA, I guess it’s related to the switch to WKWebview.\r\n\r\nChecking TiUIWebView.m I found that changing line #995 from @\"url\" : webView.URL.absoluteString to:\r\n@\"url\" : navigationAction.request.URL fixes the problem.\r\n\r\nDon't know if you should fix it here or on the newly introduced 'redirect' event. This was working before 8.0 and works if I change the mentioned line.\r\n", "attachment": [], "flagged": false, "summary": "Webview http redirects not working as on 7.5.1", "creator": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "subtasks": [], "reporter": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "environment": "Ti SDK 8.0.0.GA", "closedSprints": [ { "id": 1160, "state": "closed", "name": "2019 Sprint 17", "startDate": "2019-08-12T07:59:28.950Z", "endDate": "2019-08-25T07:59:00.000Z", "completeDate": "2019-08-26T15:35:29.980Z", "originBoardId": 114 }, { "id": 1161, "state": "closed", "name": "2019 Sprint 18", "startDate": "2019-08-26T21:46:26.269Z", "endDate": "2019-09-08T21:46:00.000Z", "completeDate": "2019-09-09T20:39:58.761Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "449533", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~inzori],\r\nThanks for reporting this. Can you please test this issue on SDK 8.0.2.GA and let us know how it goes?", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-07-02T04:27:55.000+0000", "updated": "2019-07-02T04:27:55.000+0000" }, { "id": "449551", "author": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "body": "Hi, it is already tested on 8.0.2.GA and the problem still remains. \r\n8.0.0.GA to 8.0.2.GA all uses {color:red}@\"url\" : webView.URL.absoluteString{color} when triggering the events beforeload and redirect.\r\nTo make it work as it used to we need it with this: {color:red}@\"url\" : navigationAction.request.URL.absoluteString{color}\r\nAt least on one of the events.\r\n\r\nThanks", "updateAuthor": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "created": "2019-07-02T15:29:49.000+0000", "updated": "2019-07-02T16:06:16.000+0000" }, { "id": "449553", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~inzori] Can you please give a complete test case to reproduce it? Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-02T16:22:39.000+0000", "updated": "2019-07-02T16:22:39.000+0000" }, { "id": "449558", "author": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "body": "Here's a test case. \r\n[Test case 8.0.2.GA|https://inzori.com/fmartinez/testwebview.zip]\r\n\r\nSteps:\r\n1- Click on \"Plaid\" button, it will open a new window with a webview that loads the page from plaid.com\r\n2- check the console log, it displays the url: {{https://cdn.plaid.com/link/v2/stable/link.html?isWebview=true&key=361a76619ae1a2e0b7da377e218f4d&env=sandbox&product=transactions&clientName=Inzori&apiVersion=v2}}\r\n3- Click on the \"X\" in the upper right corner. It should close the window and go back to the screen with the \"plaid\" button.\r\n4- It displays a white screen. Check the console log again, same URL.\r\n\r\nReplace TiUIWebView.m line 997 with {{navigationAction.request.URL.absoluteString}} instead of {{webView.URL.absoluteString}}.\r\n\r\nClean and compile again. \r\nRepeat the steps above and check the URL when clicking the \"X\", it displays: {{plaidlink://event?error_code=&error_message=&error_type=&event_name=EXIT&exit_status=requires_credentials&institution_search_query&link_session_id=f82814f9-920e-4309-8914-5a72b24c2e2f&mfa_type&request_id×tamp=2019-07-02T17%3A18%3A40.031Z&view_name}}\r\n\r\nand closes the window.", "updateAuthor": { "name": "inzori", "key": "inzori", "displayName": "Fabian Martinez", "active": true, "timeZone": "America/Montevideo" }, "created": "2019-07-02T17:29:22.000+0000", "updated": "2019-07-02T17:30:37.000+0000" }, { "id": "449559", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here you go [~inzori]. Thanks for reporting!\r\nPR - https://github.com/appcelerator/titanium_mobile/pull/11020\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-02T17:57:08.000+0000", "updated": "2019-07-02T17:57:50.000+0000" }, { "id": "450465", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR passed.waiting for PR's merge", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-08-13T22:33:42.000+0000", "updated": "2019-08-13T22:33:42.000+0000" }, { "id": "450777", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~vijaysingh] Please could you add a PR for 8_3_X.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-23T15:23:28.000+0000", "updated": "2019-08-23T15:23:28.000+0000" }, { "id": "450963", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master (8.2.0)", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-08-29T19:08:40.000+0000", "updated": "2019-08-29T19:08:40.000+0000" }, { "id": "450973", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on sdk 8.2.0.v20190829124255.Webview http redirect works as expected. closing\r\n{CODE}\r\nName = Mac OS X\r\n Version = 10.14.5\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 10.16.2\r\n npm Version = 6.9.0\r\nTitanium CLI\r\n CLI Version = 5.2.1\r\nTitanium SDK\r\n SDK Version = 8.2.0.v20190829124255\r\nDevice -iPhone XR iOS 13\r\nSimulator -iPhone 6 iOS 12\r\n{CODE}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-08-29T21:48:01.000+0000", "updated": "2019-08-29T21:48:01.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }