Skip to content

Commit b748899

Browse files
authored
fix(android): missing intent filters and wc scheme for walletconnect (#6630)
### Description With the switch to Expo, we missed the intent filters for App Links and `wc` scheme handling needed for WalletConnect to work. ### Test plan - Checked the generated `AndroidManifest.xml` has the expected content: ```xml <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="celo"/> <data android:scheme="wc"/> <data android:scheme="co.clabs.valora"/> <data android:scheme="exp+valora"/> </intent-filter> <intent-filter android:autoVerify="true" data-generated="true"> <action android:name="android.intent.action.VIEW"/> <data android:scheme="https" android:host="valoraapp.com"/> <data android:scheme="https" android:host="vlra.app"/> <data android:pathPrefix="/wc"/> <data android:scheme="http"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> ``` Which is similar as before the switch to Expo (see working [previous manifest](https://github.com/valora-inc/wallet/blob/041f6d170ec319a51764ee3c4ef000f5575f1b19/android/app/src/main/AndroidManifest.xml#L29-L43)). - Manually tested WC works again ### Related issues - See Slack [thread](https://valora-app.slack.com/archives/C04B61SJ6DS/p1744827789197039). ### Backwards compatibility Yes ### Network scalability If a new NetworkId and/or Network are added in the future, the changes in this PR will: - [x] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
1 parent fb6124e commit b748899

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

app.config.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ module.exports = () => {
5353
expo: {
5454
name,
5555
slug: 'valora',
56-
scheme: 'celo',
56+
// Main scheme should be first (see index.tsx)
57+
scheme: ['celo', 'wc'],
5758
version,
5859
orientation: 'portrait',
5960
icon: './assets/icon/icon.png',
@@ -111,6 +112,20 @@ module.exports = () => {
111112
xxxhdpi: './assets/splash/xxxhdpi.jpg',
112113
},
113114
package: bundleId,
115+
// App Links
116+
intentFilters: [
117+
{
118+
action: 'VIEW',
119+
autoVerify: true,
120+
data: [
121+
{ scheme: 'https', host: 'valoraapp.com' },
122+
{ scheme: 'https', host: 'vlra.app' },
123+
{ pathPrefix: '/wc' },
124+
{ scheme: 'http' },
125+
],
126+
category: ['BROWSABLE', 'DEFAULT'],
127+
},
128+
],
114129
permissions: [
115130
'android.permission.CAMERA',
116131
'android.permission.ACCESS_NETWORK_STATE',

index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (!expoConfig) {
1414
const App = createApp({
1515
registryName: expoConfig.extra?.registryName,
1616
displayName: expoConfig.name,
17-
deepLinkUrlScheme: expoConfig.scheme as string,
17+
deepLinkUrlScheme: expoConfig.scheme![0],
1818
ios: { appStoreId: expoConfig.extra?.appStoreId },
1919
networks: expoConfig.extra?.networks,
2020
divviProtocol: {

0 commit comments

Comments
 (0)