diff --git a/example/wallet/android/app/src/main/AndroidManifest.xml b/example/wallet/android/app/src/main/AndroidManifest.xml index 990c32ba..a3caaa44 100644 --- a/example/wallet/android/app/src/main/AndroidManifest.xml +++ b/example/wallet/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + if (call.method == "initialLink") { + if (initialLink != null) { + result.success(initialLink) + } + } + } + } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + if (intent.action === Intent.ACTION_VIEW) { + linksReceiver?.onReceive(this.applicationContext, intent) + } + } + + fun createChangeReceiver(events: EventChannel.EventSink): BroadcastReceiver? { + return object : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + val dataString = intent.dataString ?: + events.error("UNAVAILABLE", "Link unavailable", null) + events.success(dataString) + } + } + } } diff --git a/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..036d09bc --- /dev/null +++ b/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..036d09bc --- /dev/null +++ b/example/wallet/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b..00000000 Binary files a/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..e09e8027 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 00000000..ac5c5abd Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..d1f55da6 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79..00000000 Binary files a/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..d33a956a Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 00000000..8b6807ca Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..69255e04 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d43914..00000000 Binary files a/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..2d56154f Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 00000000..68c67d3c Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..e1ca676a Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d3..00000000 Binary files a/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..b05e29ce Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 00000000..e809421c Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..5e0d5988 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372ee..00000000 Binary files a/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..1c285646 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 00000000..2d34e5d2 Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..025435dc Binary files /dev/null and b/example/wallet/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/example/wallet/android/app/src/main/res/values/ic_launcher_background.xml b/example/wallet/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 00000000..0b6c92b2 --- /dev/null +++ b/example/wallet/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #F5EDFF + \ No newline at end of file diff --git a/example/wallet/ios/Runner/Info.plist b/example/wallet/ios/Runner/Info.plist index 5f4039c0..ed04ff0f 100644 --- a/example/wallet/ios/Runner/Info.plist +++ b/example/wallet/ios/Runner/Info.plist @@ -7,7 +7,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Web3Wallet + Web3Wallet Flutter CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +15,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Web3Wallet + web3wallet_flutter CFBundlePackageType APPL CFBundleShortVersionString @@ -64,9 +64,5 @@ FlutterDeepLinkingEnabled - LSApplicationQueriesSchemes - - web3modalflutter - diff --git a/example/wallet/lib/dependencies/deep_link_handler.dart b/example/wallet/lib/dependencies/deep_link_handler.dart index ec453905..56d83a8c 100644 --- a/example/wallet/lib/dependencies/deep_link_handler.dart +++ b/example/wallet/lib/dependencies/deep_link_handler.dart @@ -21,7 +21,10 @@ class DeepLinkHandler { static void checkInitialLink() { try { - _methodChannel.invokeMethod('initialLink'); + _methodChannel.invokeMethod('initialLink').then( + _onLink, + onError: _onError, + ); } catch (e) { debugPrint('[DeepLinkHandler] checkInitialLink $e'); } @@ -36,12 +39,7 @@ class DeepLinkHandler { }) async { await Future.delayed(Duration(milliseconds: delay)); try { - final canLaunch = await canLaunchUrlString(scheme); - if (canLaunch) { - launchUrlString(scheme, mode: LaunchMode.externalApplication); - } else { - throw Exception('Can not launch scheme'); - } + await launchUrlString(scheme, mode: LaunchMode.externalApplication); } catch (e) { debugPrint('[DeepLinkHandler] error re-opening dapp ($scheme). $e'); _goBackModal(title: modalTitle); diff --git a/example/wallet/lib/dependencies/web3wallet_service.dart b/example/wallet/lib/dependencies/web3wallet_service.dart index a8ed8d14..fd259042 100644 --- a/example/wallet/lib/dependencies/web3wallet_service.dart +++ b/example/wallet/lib/dependencies/web3wallet_service.dart @@ -46,7 +46,7 @@ class Web3WalletService extends IWeb3WalletService { description: 'Web3Wallet Flutter Example', url: 'https://walletconnect.com/', icons: [ - 'https://images.prismic.io/wallet-connect/65785a56531ac2845a260732_WalletConnect-App-Logo-1024X1024.png' + 'https://raw.githubusercontent.com/WalletConnect/WalletConnectFlutterV2/master/example/wallet/AppIcon.png' ], redirect: Redirect( native: 'wcflutterwallet://',