Skip to content

Commit

Permalink
retro compatibility of scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Jul 24, 2024
1 parent fd5d4cb commit 35c7ebe
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 12 deletions.
15 changes: 15 additions & 0 deletions example/dapp/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<package android:name="com.walletconnect.flutterwallet"/>
<package android:name="com.walletconnect.flutterwallet.internal"/>
</queries>
<application
android:label="Web3Dapp Flutter"
android:name="${applicationName}"
Expand All @@ -24,6 +33,12 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterdapp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
14 changes: 12 additions & 2 deletions example/dapp/ios/Runner/Info-internal.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterdapp.internal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -28,12 +28,22 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterdapp.internal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterdapp-internal</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.walletconnect.flutterdapp.internal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterdapp</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>2</string>
Expand Down
4 changes: 2 additions & 2 deletions example/dapp/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterdapp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -28,7 +28,7 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterdapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterdapp-production</string>
Expand Down
2 changes: 1 addition & 1 deletion example/dapp/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
redirect: Redirect(
native: 'wcflutterdapp-$flavor://',
universal: 'https://walletconnect.com',
// universal: 'https://walletconnect.com',
),
),
);
Expand Down
1 change: 0 additions & 1 deletion example/dapp/lib/pages/connect_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ class ConnectPageState extends State<ConnectPage> {
final encodedUri = Uri.encodeComponent(connectResponse.uri.toString());
const flavor = String.fromEnvironment('FLUTTER_APP_FLAVOR');
final uri = 'wcflutterwallet-$flavor://wc?uri=$encodedUri';
// final uri = 'metamask://wc?uri=$encodedUri';
if (await canLaunchUrlString(uri)) {
final openApp = await showDialog(
// ignore: use_build_context_synchronously
Expand Down
8 changes: 7 additions & 1 deletion example/wallet/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterwallet-production" />
<data android:scheme="wcflutterwallet" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterwallet-internal" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterwallet-production" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
14 changes: 12 additions & 2 deletions example/wallet/ios/Runner/Info-internal.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterwallet.internal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -28,12 +28,22 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterwallet.internal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterwallet-internal</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.walletconnect.flutterwallet.internal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterwallet</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
Expand Down
4 changes: 2 additions & 2 deletions example/wallet/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterwallet</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -28,7 +28,7 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.walletconnect.flutterwallet</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterwallet-production</string>
Expand Down
2 changes: 1 addition & 1 deletion example/wallet/lib/dependencies/web3wallet_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Web3WalletService extends IWeb3WalletService {
],
redirect: Redirect(
native: 'wcflutterwallet-$flavor://',
universal: 'https://walletconnect.com',
// universal: 'https://walletconnect.com',
),
),
);
Expand Down

0 comments on commit 35c7ebe

Please sign in to comment.