Skip to content

Commit

Permalink
Merge pull request #24 from Nuxify/feature/integrate-other-wallets
Browse files Browse the repository at this point in the history
feat: integrate other wallets
  • Loading branch information
JosesGabriel authored Jun 19, 2024
2 parents 4b190fc + 31bc61e commit 0de7adb
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
6 changes: 6 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@

<queries>
<package android:name="io.metamask" />
<package android:name="org.toshi"/>
<package android:name="co.mona.android"/>
<package android:name="com.wallet.crypto.trustapp"/>
<package android:name="com.zengo.wallet"/>
<package android:name="exodusmovement.exodus"/>
<package android:name="piuk.blockchain.android"/>
<!-- Add other wallet schemes names here -->
</queries>
</manifest>
26 changes: 26 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit
import Flutter
import CoinbaseWalletSDK

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand All @@ -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
}
}
6 changes: 6 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<key>LSApplicationQueriesSchemes</key>
<array>
<string>metamask</string>
<string>toshi</string>
<string>mona</string>
<string>trust</string>
<string>zengo</string>
<string>exodus</string>
<string>blockchain</string>
<!-- Add other wallet schemes names here -->
</array>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand Down
18 changes: 14 additions & 4 deletions lib/application/service/cubit/web3_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,31 @@ class Web3Cubit extends Cubit<Web3State> {

Future<void> instantiate() async {
try {
const String url = 'https://github.com/Nuxify/Sophon';
w3mService = W3MService(
enableEmail: true,
projectId: '2684f2b98f5ae4051dce454b5862b9ff',
metadata: const PairingMetadata(
name: 'Sophon',
description:
'A Flutter template for building amazing decentralized applications.',
url: 'https://github.com/Nuxify/Sophon',
url: url,
icons: <String>[
'https://files-nuximart.sgp1.cdn.digitaloceanspaces.com/nuxify-website/blog/images/Nuxify-logo.png',
],
redirect: Redirect(
universal: url,
native: url,
),
),
excludedWalletIds: <String>{
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0',
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa',
includedWalletIds: <String>{
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // metamask
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // trust
'e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4', // exodus
'f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d', // crypto.com
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // coinbase
'9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0', // zengo
'84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04', // blockchain.com
},
);
await w3mService.init();
Expand Down

0 comments on commit 0de7adb

Please sign in to comment.