Skip to content

Commit 6672c80

Browse files
authored
Merge pull request #606 from reown-com/feature/solflare_wallet_support
[Flutter] Documentation for Solflare Wallet
2 parents b78ecfe + c8dea8b commit 6672c80

File tree

1 file changed

+128
-11
lines changed

1 file changed

+128
-11
lines changed

appkit/flutter/core/installation.mdx

Lines changed: 128 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Let's get started with the installation and configuration!
1313
If you are just starting a new project, you can use our [CLI tool](https://pub.dev/packages/reown_cli) to get started quickly.
1414
</Note>
1515

16-
1. - Add `reown_appkit` as dependency in your `pubspec.yaml` and run `flutter pub get` (check out the [latest version](https://pub.dev/packages/reown_appkit/install))
16+
1. - Add `reown_appkit` as a dependency in your `pubspec.yaml` and run `flutter pub get` (check out the [latest version](https://pub.dev/packages/reown_appkit/install))
1717
- Or simply run `flutter pub add reown_appkit`
1818
2. - Locate your `/ios/Podfile` file and add the following as the first line:
1919

2020
```ruby
2121
platform :ios, '13.0'
2222
```
2323

24-
3. - Run `$ pod install` inside `/ios` folder.
24+
3. - Run `$ pod install` inside the `/ios` folder.
2525
4. - You should now be able to run your app with `flutter run --dart-define=PROJECT_ID={your_project_id}`
2626

2727
### Enable Installed Wallet Detection
@@ -140,7 +140,7 @@ override func application(_ application: UIApplication, continue userActivity: N
140140
}
141141
```
142142

143-
Checkout out the [AppDelegate.swift](https://github.com/reown-com/reown_flutter/blob/master/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift) file from our sample dapp for reference.
143+
Check out the [AppDelegate.swift](https://github.com/reown-com/reown_flutter/blob/master/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift) file from our sample dapp for reference.
144144

145145
</Tab>
146146
<Tab title="Android">
@@ -170,7 +170,7 @@ Example:
170170

171171
#### Disable Coinbase Wallet
172172

173-
Coinbase Wallet is enabled by default even if, in order to function properly, a few steps has to be done as described in the previous section. However, if you don't want to include/support Coinbase Wallet on your app you just need to pass Coinbase Wallet id `fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa` to [excludedWalletIds](./options#excludedwalletids) options Array.
173+
Coinbase Wallet is enabled by default even though, in order to function properly, a few steps have to be done as described in the previous section. However, if you don't want to include/support Coinbase Wallet in your app you just need to pass Coinbase Wallet id `fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa` to [excludedWalletIds](./options#excludedwalletids) options Array.
174174

175175
<hr />
176176

@@ -186,14 +186,59 @@ This means that pairing topic, session topic, session events and other session-r
186186

187187
Furthermore, Phantom Wallet's deep/universal linking mechanism supports interaction exclusively with the Solana network. This means that if you have EVM networks configured in your AppKit instance, they will not be available for use after connecting with Phantom.
188188

189-
In order to support Phantom Wallet interactions a few extra steps has to be performed (only if you haven't implemented [Link Mode](./link-mode) already).
189+
In order to support Phantom Wallet interactions, a few extra steps have to be performed (only if you haven't implemented [Link Mode](./link-mode) already).
190190

191-
1. First, be sure you already have your redirection back property configure in your dApp's metadata. See [Redirect to your dApp](./usage#redirect-to-your-dapp)
192-
2. Then you will have to implement your own Deep Link mechanism on Flutter (and native) side so when a link is received through it, you would just call `await _appKitModal.dispatchEnvelope(link);`
191+
1. First, be sure you already have your redirection back property configured in your dApp's metadata. See [Redirect to your dApp](./usage#redirect-to-your-dapp)
192+
2. Then you will have to implement your own Deep Link mechanism on the Flutter (and native) side so that when a link is received through it, you can just call `await _appKitModal.dispatchEnvelope(link);`
193193

194-
As a guidance, here you can see how it's done in our sample dApp:
194+
As guidance, here you can see how it's done in our sample dApp:
195195

196-
##### First, on Flutter side we create an `EventChannel` where links are going to be received and passed to `dispatchEnvelope()`.
196+
#### First, enable Phantom Wallet detection
197+
198+
<Tabs>
199+
<Tab title="iOS">
200+
201+
1. Open your `Info.plist` file.
202+
2. Locate the `<key>LSApplicationQueriesSchemes</key>` section.
203+
3. Include `<string>phantom</string>` scheme
204+
205+
Example:
206+
207+
```xml
208+
<key>LSApplicationQueriesSchemes</key>
209+
<array>
210+
<string>phantom</string>
211+
<!-- Any other scheme previously added -->
212+
</array>
213+
```
214+
215+
</Tab>
216+
<Tab title="Android">
217+
218+
1. Open your `AndroidManifest.xml` file.
219+
2. Add `<package android:name="app.phantom"/>` scheme inside `<queries>...</queries>` as mentioned above in previous section
220+
221+
Example:
222+
223+
```xml
224+
<?xml version="1.0" encoding="utf-8"?>
225+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
226+
227+
<queries>
228+
<package android:name="app.phantom"/>
229+
<!-- Any other scheme previously added -->
230+
</queries>
231+
232+
<application>
233+
...
234+
</application>
235+
</manifest>
236+
```
237+
238+
</Tab>
239+
</Tabs>
240+
241+
#### Then, on Flutter side we create an `EventChannel` where links are going to be received and passed to `dispatchEnvelope()`.
197242

198243
<Tabs>
199244
<Tab title="Flutter">
@@ -233,7 +278,7 @@ class DeepLinkHandler {
233278
</Tab>
234279
</Tabs>
235280

236-
##### Then, on both native sides we leverage native APIs to capture the app opening link and send it to Flutter side.
281+
#### Then, on both native sides we leverage native APIs to capture the app opening link and send it to Flutter side.
237282

238283
<Tabs>
239284
<Tab title="iOS">
@@ -373,7 +418,79 @@ _Constructing a Solana transaction would depend on the library/package of your c
373418

374419
#### Disable Phantom Wallet
375420

376-
Phantom Wallet is enabled by default even if, in order to function properly, a few steps has to be done as described in the previous section. However, if you don't want to include/support Phantom Wallet on your app you just need to pass Phantom Wallet id `a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393` to [excludedWalletIds](./options#excludedwalletids) options Array.
421+
Phantom Wallet is enabled by default even though, in order to function properly, a few steps have to be done as described in the previous section. However, if you don't want to include/support Phantom Wallet in your app you just need to pass Phantom Wallet id `a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393` to [excludedWalletIds](./options#excludedwalletids) options Array.
422+
423+
<hr />
424+
425+
### Solflare Wallet support
426+
427+
<Note>
428+
Solflare Wallet support is available from `reown_appkit: ^1.6.0`.
429+
</Note>
430+
431+
Similar to Phantom Wallet, Solflare does not use the WalletConnect protocol for communication between the dApp and the wallet, instead it provides an internal API mechanism based on deep/universal links.
432+
433+
This means that pairing topic, session topic, session events and other session-related features are not available when connecting to Solflare Wallet and the interaction is really basic. Dapp sends a request, Solflare Wallet responds. That's all.
434+
435+
Furthermore, Solflare Wallet's deep/universal linking mechanism supports interaction exclusively with the Solana network. This means that if you have EVM networks configured in your AppKit instance, they will not be available for use after connecting with Solflare.
436+
437+
In order to support Solflare Wallet interactions, a few extra steps have to be performed (only if you haven't implemented [Link Mode](./link-mode) already).
438+
439+
1. First, be sure you already have your redirection back property configured in your dApp's metadata. See [Redirect to your dApp](./usage#redirect-to-your-dapp)
440+
2. Then you will have to implement your own Deep Link mechanism on the Flutter (and native) side so that when a link is received through it, you can just call `await _appKitModal.dispatchEnvelope(link);`
441+
442+
As guidance, here you can see how it's done in our sample dApp:
443+
444+
#### First, enable Solflare Wallet detection
445+
446+
<Tabs>
447+
<Tab title="iOS">
448+
449+
1. Open your `Info.plist` file.
450+
2. Locate the `<key>LSApplicationQueriesSchemes</key>` section.
451+
3. Include `<string>solflare</string>` scheme
452+
453+
Example:
454+
455+
```xml
456+
<key>LSApplicationQueriesSchemes</key>
457+
<array>
458+
<string>solflare</string>
459+
<!-- Any other scheme previously added -->
460+
</array>
461+
```
462+
463+
</Tab>
464+
<Tab title="Android">
465+
466+
1. Open your `AndroidManifest.xml` file.
467+
2. Add `<package android:name="com.solflare.mobile"/>` scheme inside `<queries>...</queries>` as mentioned above in previous section
468+
469+
Example:
470+
471+
```xml
472+
<?xml version="1.0" encoding="utf-8"?>
473+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
474+
475+
<queries>
476+
<package android:name="com.solflare.mobile"/>
477+
<!-- Any other scheme previously added -->
478+
</queries>
479+
480+
<application>
481+
...
482+
</application>
483+
</manifest>
484+
```
485+
486+
</Tab>
487+
</Tabs>
488+
489+
The rest of the configuration is identical to Phantom's configuration.
490+
491+
#### Disable Solflare Wallet
492+
493+
Solflare Wallet is enabled by default even though, in order to function properly, a few steps have to be done as described in the previous section. However, if you don't want to include/support Solflare Wallet in your app you just need to pass Solflare Wallet id `1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79` to [excludedWalletIds](./options#excludedwalletids) options Array.
377494

378495
## Example
379496

0 commit comments

Comments
 (0)