Using url scheme to launch app, how to specify starting activity?

aluzi liu
366
Reputation points
My app using AppShell, I have two TabBar in AppShell.xaml, one is LoginPage, another is MainPage. If login success, I will goto MainPage using this:
Shell.Current.GoToAsync("//Main", false);
My problem is, If launch app in browser using url scheme, each time the app launch, it will display the LoginPage even though I have logon to MainPage.
How to make the app keep MainPage when launch from url scheme?
I add this code to AndroidManifest.xml:
<application android:label="Label A">
<activity android:icon="@drawable/Icon" android:label="LabelB" android:name=".MainActivity">
<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="myapp" />
</intent-filter>
</activity>
</application>
And in html page, I using this code to launch app:
<a href="myapp://test.com/?name=xxx">Open App test</a>