When a user visits the browser page for my app I am forwarding them to a url scheme like so:
intent://share?id=123#Intent;package=com.aerstone.mobile;scheme=myapp;launchFlags=268435456;end;
I've tested this and this works fine. Now, when the user visits my app's home page from the browser and have the app installed, the app automatically opens up.
Relevant part from my manifest is:
<activity android:configChanges="keyboardHidden|orientation" android:label="@string/app_name"
android:name=".ui.activity.MainActivity"
android:launchMode="singleTask" >
<!-- add the above launchMode attribute -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- add the below additional intent-filter -->
<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>
Question
After the app opens up, how can I fetch the URL? I want to fetch the id=123
part of the URL. How can I do this?