Create Deep Links in app content:
<activity android:name="com.example.android.GizmosActivity" android:label="@string/title_gizmos" > <intent-filter android:label="@string/filter_view_http_gizmos"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="www.example.com" android:pathPrefix="/gizmos" /> </intent-filter> <intent-filter android:label="@string/filter_view_example_gizmos"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="example" android:host="gizmos" /> </intent-filter> </activity>
Reading data from incoming objects:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); String action = intent.getAction(); Uri data = intent.getData(); }
Check your deep links:
The general syntax for testing an intent filter URI with adb is:
$ adb shell am start -W -a android.intent.action.VIEW -d <URI> <PACKAGE>
For example, the command below attempts to view the target application action associated with the specified URI.
$ adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android
More details:
1) https://developer.android.com/training/app-links/verify-site-associations.html#the-difference
2) https://docs.branch.io/pages/links/integrate/
source share