Call Linking.getInitialURL() in launchApp (#3843)

This commit is contained in:
Miguel Alatzar 2020-01-22 11:06:56 -07:00 committed by Elias Nahum
parent b8ee415db7
commit d56965e4ce
2 changed files with 6 additions and 5 deletions

View file

@ -29,7 +29,8 @@
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View file

@ -58,6 +58,10 @@ const launchApp = (credentials) => {
telemetry.startSinceLaunch(['start:splash_screen']);
EphemeralStore.appStarted = true;
Linking.getInitialURL().then((url) => {
store.dispatch(setDeepLinkURL(url));
});
};
const launchAppAndAuthenticateIfNeeded = async (credentials) => {
@ -73,10 +77,6 @@ const launchAppAndAuthenticateIfNeeded = async (credentials) => {
await emmProvider.handleAuthentication(store);
}
}
Linking.getInitialURL().then((url) => {
store.dispatch(setDeepLinkURL(url));
});
};
Navigation.events().registerAppLaunchedListener(() => {