{"action":"created","issue":{"url":"https://api.github.com/repos/plaid/link/issues/237","repository_url":"https://api.github.com/repos/plaid/link","labels_url":"https://api.github.com/repos/plaid/link/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/plaid/link/issues/237/comments","events_url":"https://api.github.com/repos/plaid/link/issues/237/events","html_url":"https://github.com/plaid/link/issues/237","id":305646325,"number":237,"title":"link-initialize.js silently fails on iOS hybrid (Cordova) app","user":{"login":"andreipopovici","id":1143417,"avatar_url":"https://avatars0.githubusercontent.com/u/1143417?v=4","gravatar_id":"","url":"https://api.github.com/users/andreipopovici","html_url":"https://github.com/andreipopovici","followers_url":"https://api.github.com/users/andreipopovici/followers","following_url":"https://api.github.com/users/andreipopovici/following{/other_user}","gists_url":"https://api.github.com/users/andreipopovici/gists{/gist_id}","starred_url":"https://api.github.com/users/andreipopovici/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreipopovici/subscriptions","organizations_url":"https://api.github.com/users/andreipopovici/orgs","repos_url":"https://api.github.com/users/andreipopovici/repos","events_url":"https://api.github.com/users/andreipopovici/events{/privacy}","received_events_url":"https://api.github.com/users/andreipopovici/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-15T17:21:35Z","updated_at":"2018-03-20T19:00:10Z","closed_at":null,"author_association":"NONE","body":"This may be a bit hard to reproduce, but I'd like to at least get a hint about how to continue troubleshooting.\r\n\r\n## Setup details:\r\n- Cordova hybrid app (standard WebView)\r\n- iOS 11.2 running in simulator, with Safari Developer Tools connected\r\n- custom Plaid Link web integration, identical code running for existing Vue.js webapp and hybrid Cordova app\r\n- `sandbox` env\r\n\r\n## Steps to reproduce:\r\n- load `https://cdn.plaid.com/link/v2/stable/link-initialize.js` using async script loader\r\n- create link handler with an `onLoad` function\r\n- call `open()` on link handler either directly or from a click event handler\r\n\r\n## Expected result:\r\n\r\n`onLoad` function should get called. Plaid Link widget should open. (At the very least, an error should be thrown.)\r\n\r\nThis correctly occurs in the following situations:\r\n- with the same code deployed as a webapp, in mobile Safari, in the same iOS simulator\r\n- with the same code, as a hybrid mobile app compiled for Android, running in a simulator or actual device\r\n- any other situation except in the hybrid app running on iOS\r\n\r\n## Actual result:\r\n\r\nThe `onLoad()` handler never gets called. Calling `open()` on the link handler does nothing. No errors get thrown.\r\n\r\n## Reproducing the issue:\r\n\r\nWith the hybrid app loaded in the iOS simulator, I connected using the desktop Safari Developer Tools and ran the following:\r\n\r\n![screen shot 2018-03-15 at 6 56 46 pm](https://user-images.githubusercontent.com/1143417/37479544-91bf3f3c-2885-11e8-9c33-89222492fcb1.png)\r\n\r\nThe result was the same as above: no error, no `onLoad` called, no widget.\r\n\r\nIn the Network tab, there are no additional requests to the Plaid CDN after `link-initialize.js`, whereas in the other successful situations, it correctly fetches `link.js` and other resources. This leads me to believe that `link-initialize.js` never runs, or never throws an error and silently fails.\r\n\r\n## Help!\r\nCan you please suggest anything else I can do to figure out why `link-initialize.js` silently fails in iOS WebViews only?\r\n"},"comment":{"url":"https://api.github.com/repos/plaid/link/issues/comments/374717890","html_url":"https://github.com/plaid/link/issues/237#issuecomment-374717890","issue_url":"https://api.github.com/repos/plaid/link/issues/237","id":374717890,"user":{"login":"pbernasconi","id":1716394,"avatar_url":"https://avatars3.githubusercontent.com/u/1716394?v=4","gravatar_id":"","url":"https://api.github.com/users/pbernasconi","html_url":"https://github.com/pbernasconi","followers_url":"https://api.github.com/users/pbernasconi/followers","following_url":"https://api.github.com/users/pbernasconi/following{/other_user}","gists_url":"https://api.github.com/users/pbernasconi/gists{/gist_id}","starred_url":"https://api.github.com/users/pbernasconi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbernasconi/subscriptions","organizations_url":"https://api.github.com/users/pbernasconi/orgs","repos_url":"https://api.github.com/users/pbernasconi/repos","events_url":"https://api.github.com/users/pbernasconi/events{/privacy}","received_events_url":"https://api.github.com/users/pbernasconi/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T19:00:10Z","updated_at":"2018-03-20T19:00:10Z","author_association":"MEMBER","body":"Hi @andreipopovici – please excuse the late response here. It seems you're running into an issue where Link is likely opening into a new tab in your iOS WebView, which is a fallback when link-initialize determines that it cannot operate well inside of the parent window on mobile (eg: in an iFrame).\r\n\r\nI believe the `forceIframe: true` flag will fix this for your integration on iOS. It's currently an undocumented configuration flag in Link for Web, and we plan on improving the developer experience around integrating Link in a Webview in the near future so stay tuned for an update there. By adding this flag to your `Plaid.create` object, it will force Link to always open in the same window and hopefully fix your integration.\r\n\r\nPlease let us know if this doesn't work and we can help you dive deeper. Thanks!\r\n\r\n"}}
{"actor":{"display_login":"pbernasconi"}}