I have some links that should redirect to specific pages in my app; I followed the instructions on https://reactnavigation.org/docs/5.x/deep-linking/ and it works fine on previous Android versions, but on version 13, they all redirect to the Home page.
AndroidManifest.xml:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:exported="true"
android:launchMode="singleTask">
<intent-filter android:autoVerify="true" tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="campanha.soustix.com.br"/>
</intent-filter>
<intent-filter>
<action android:name="br.com.soustix.NOTIFICATIONPRESSED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
deepLinkRoutes.rs:
export const linkingConfig = {
config: {
screens: {
Home: {
screens: {
HomePage: 'app',
MyExchanges: 'vouchers',
Explore: 'explore'
}
},
ProductDetail: 'product/:id',
P2PPresentation: 'p2p',
MGM: 'invitefriends',
Extract: 'extract',
MyAccount: 'myaccount',
JoinStix: 'joinstix',
Login: 'iam',
Catalog: 'catalog',
PartnerDetail: 'iupp',
Search: 'categories/:rootCategory'
}
}
};
App.tsx:
import { linkingConfig } from './src/config/deepLinkRoutes';
//rest of the code
<NavigationContainer linking={{ prefixes: ['
https://campanha.soustix.com.br/redirect'] }} >
I tried to run adb shell am start -W -a android.intent.action.VIEW -d "https://campanha.soustix.com.br/redirect/p2p" br.com.soustixp
but I just get error: activity not started, unable to resolve intent { act=android.intent.action.view dat=https://campanhasoustix.com.br/... flg=0x10000000 pkg=br.com.soustix }
Also tried adding android:pathPrefix="/redirect/p2p" to the data tag but that didn't work either. Please, what am I missing?