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

aluzi liu 486 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">
      <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" />

And in html page, I using this code to launch app:

<a href="myapp://">Open App test</a>
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,326 questions
{count} votes