Skip to content

Commit

Permalink
minot change
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Mar 11, 2024
1 parent 50cfaee commit ea4a8f4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
7 changes: 7 additions & 0 deletions lib/apis/sign_api/sign_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ class SignEngine implements ISignEngine {
return;
}

final validation = await WalletConnectUtils.validateRedirect(
metadata.redirect,
);
if (validation != null) {
core.logger.e(validation);
}

await core.pairing.init();
await core.verify.init(verifyUrl: metadata.verifyUrl);
await proposals.init();
Expand Down
11 changes: 8 additions & 3 deletions lib/apis/utils/walletconnect_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class WalletConnectUtils {
);
if (metaDataValue == null) {
return 'CFBundleURLTypes\'s key is missing on iOS\'s Info.plist.\n'
'If you want deep linking to work this key must be added.\n'
'Check out https://docs.walletconnect.com/web3wallet/mobileLinking on how to include it';
}
final properties = metaDataValue as List;
Expand All @@ -224,13 +225,17 @@ class WalletConnectUtils {
final universalLink = redirect?.universal ?? '';
if (nativeSchema.isEmpty && universalLink.isEmpty) {
return 'No metadata.redirect object has been set\n'
'Check out https://docs.walletconnect.com/web3wallet/wallet-usage#initialization';
'If you want deep linking to work redirect object must be set.\n'
'Check out https://docs.walletconnect.com/web3wallet/wallet-usage#initialization ';
}
if (nativeSchema.isEmpty) {
return 'Metadata\'s native redirect value has not been set\n'
'Check out https://docs.walletconnect.com/web3wallet/wallet-usage#initialization';
'Check out https://docs.walletconnect.com/web3wallet/wallet-usage#initialization ';
}
final uri = Uri.parse(nativeSchema);
if (uri.scheme.isEmpty) {
return 'Metadata\'s native redirect must be a valid scheme. E.g.: example:// ';
}
if (!plistSchemas.contains(uri.scheme)) {
return 'Metadata\'s native redirect ($uri) is not included under CFBundleURLSchemes\'s key.\n'
'Check out https://docs.walletconnect.com/web3wallet/mobileLinking on how to include it';
Expand All @@ -239,7 +244,7 @@ class WalletConnectUtils {
}
return null;
} catch (e) {
return 'Web3Wallet: failed to get iOS configuration: $e';
return 'Failed to get iOS configuration: $e';
}
}
}
7 changes: 0 additions & 7 deletions lib/apis/web3app/web3app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,6 @@ class Web3App implements IWeb3App {
return;
}

final validation = await WalletConnectUtils.validateRedirect(
metadata.redirect,
);
if (validation != null) {
core.logger.e(validation);
}

await core.start();
await signEngine.init();
await authEngine.init();
Expand Down
7 changes: 0 additions & 7 deletions lib/apis/web3wallet/web3wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ class Web3Wallet implements IWeb3Wallet {
return;
}

final validation = await WalletConnectUtils.validateRedirect(
metadata.redirect,
);
if (validation != null) {
core.logger.e(validation);
}

await core.start();
await signEngine.init();
await authEngine.init();
Expand Down

0 comments on commit ea4a8f4

Please sign in to comment.