Skip to content

Commit

Permalink
fix on sample dapp
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Aug 27, 2024
1 parent 6673f8c commit 8e1303f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions example/dapp/lib/pages/connect_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,17 @@ class ConnectPageState extends State<ConnectPage> {
walletUniversalLink: universalLink,
);

debugPrint('[SampleDapp] authResponse.uri ${authResponse.uri}');
try {
debugPrint('[SampleDapp] authResponse.uri ${authResponse.uri}');
await WalletConnectUtils.openURL(authResponse.uri.toString());
// If response uri is not universalLink show QR Code
if (authResponse.uri?.authority != Uri.parse(universalLink).authority) {
_showQrCode('${authResponse.uri}', walletScheme: nativeLink);
} else {
await WalletConnectUtils.openURL(authResponse.uri.toString());
}
} catch (e) {
_showQrCode(
authResponse.uri.toString(),
walletScheme: nativeLink,
);
debugPrint('[SampleDapp] authResponse error $e');
_showQrCode('${authResponse.uri}', walletScheme: nativeLink);
}

try {
Expand Down

0 comments on commit 8e1303f

Please sign in to comment.