I've a React-Native app with the following code (here App.js, the app entry point) that manages deep link on Android.
Linking.getInitialURL().then((deepLinkUrl) => {
if (deepLinkUrl) {
manageDeepLink(deepLinkUrl);
} else {
Navigation.startSingleScreenApp('rootScreen');
}
});
The problem here is that getInitialURL is called every time I launch my app, from both deep link or normally, and everytime it contains deepLinkUrl parameter empty. I've registered in AndroidManifest my intent as follows:
<application
android:name=".MainApplication"
android:allowBackup="true"
android:launchMode="singleTask"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize">
<!-- deeplink -->
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
UPDATE I'm using react-native navigation to register screens, if this can e useful.