Skip to content

Commit c57516a

Browse files
Fix/deeplink from webview for android (coinbase#1121)
* fix: anchor tag approach to cover both iOS and Android cases * fix: add expected target --------- Co-authored-by: Pedro Rosario <[email protected]>
1 parent 9aba4c2 commit c57516a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/wallet-sdk/src/relay/mobile/MobileRelayUI.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export class MobileRelayUI implements RelayUI {
3232
url.searchParams.append('wl_url', walletLinkUrl);
3333
}
3434

35-
window.location.href = url.href;
36-
35+
const anchorTag = document.createElement('a');
36+
anchorTag.target = 'cbw-opener';
37+
anchorTag.href = url.href;
38+
anchorTag.rel = 'noreferrer noopener';
39+
anchorTag.click();
3740
}
3841

3942
openCoinbaseWalletDeeplink(walletLinkUrl?: string): void {

0 commit comments

Comments
 (0)