From f6544a4ee66c187e4a78be4ba9760324e246b68a Mon Sep 17 00:00:00 2001 From: josephgcedeno Date: Fri, 14 Jun 2024 14:29:10 +0800 Subject: [PATCH 1/3] chore: support coinbase wallet --- android/app/src/main/AndroidManifest.xml | 1 + ios/Runner/AppDelegate.swift | 26 ++++++++++++++++++++++++ ios/Runner/Info.plist | 1 + 3 files changed, 28 insertions(+) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 550ca39..878c7f8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -43,6 +43,7 @@ + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 70693e4..6aeaa04 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,5 +1,6 @@ import UIKit import Flutter +import CoinbaseWalletSDK @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -10,4 +11,29 @@ import Flutter GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + if #available(iOS 13.0, *) { + if (try? CoinbaseWalletSDK.shared.handleResponse(url)) == true { + return true + } + } else { + // Fallback on earlier versions + } + // handle other types of deep links + return false + } + + override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if #available(iOS 13.0, *) { + if let url = userActivity.webpageURL, + (try? CoinbaseWalletSDK.shared.handleResponse(url)) == true { + return true + } + } else { + // Fallback on earlier versions + } + // handle other types of deep links + return false + } } diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index d3a0396..e4eafed 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -46,6 +46,7 @@ LSApplicationQueriesSchemes metamask + cbwallet UIApplicationSupportsIndirectInputEvents From cc9acb654f6fb614b04bba4b1b45e168f42f9e76 Mon Sep 17 00:00:00 2001 From: josephgcedeno Date: Tue, 18 Jun 2024 10:58:11 +0800 Subject: [PATCH 2/3] chore: add wallets --- android/app/src/main/AndroidManifest.xml | 5 +++++ ios/Runner/Info.plist | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 878c7f8..f0c497a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -44,6 +44,11 @@ + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index e4eafed..6535116 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -46,7 +46,12 @@ LSApplicationQueriesSchemes metamask - cbwallet + toshi + mona + trust + zengo + exodus + blockchain UIApplicationSupportsIndirectInputEvents From 31bc61ea82ead752dc43b8896ec3dcdb7af9f7b0 Mon Sep 17 00:00:00 2001 From: josephgcedeno Date: Tue, 18 Jun 2024 18:03:45 +0800 Subject: [PATCH 3/3] chore: setup included wallets --- lib/application/service/cubit/web3_cubit.dart | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/application/service/cubit/web3_cubit.dart b/lib/application/service/cubit/web3_cubit.dart index df3633b..6a83ffb 100644 --- a/lib/application/service/cubit/web3_cubit.dart +++ b/lib/application/service/cubit/web3_cubit.dart @@ -32,6 +32,7 @@ class Web3Cubit extends Cubit { Future instantiate() async { try { + const String url = 'https://github.com/Nuxify/Sophon'; w3mService = W3MService( enableEmail: true, projectId: '2684f2b98f5ae4051dce454b5862b9ff', @@ -39,14 +40,23 @@ class Web3Cubit extends Cubit { name: 'Sophon', description: 'A Flutter template for building amazing decentralized applications.', - url: 'https://github.com/Nuxify/Sophon', + url: url, icons: [ 'https://files-nuximart.sgp1.cdn.digitaloceanspaces.com/nuxify-website/blog/images/Nuxify-logo.png', ], + redirect: Redirect( + universal: url, + native: url, + ), ), - excludedWalletIds: { - '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', - 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', + includedWalletIds: { + 'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // metamask + '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // trust + 'e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4', // exodus + 'f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d', // crypto.com + 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // coinbase + '9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0', // zengo + '84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04', // blockchain.com }, ); await w3mService.init();