For a deep link in a push notification to open your Android app to a specific screen, you must configure an Intent Filter in your app's AndroidManifest.xml file. This tells the Android operating system that your app can handle certain types of links.
There are two primary methods to set this up:
1. Using a Custom URL Scheme (Recommended for Simplicity)
This is the most direct way to link to content within your app. You define a unique URL structure (e.g., myapp://products) that is specific to your application.
Configuration:
In your AndroidManifest.xml, add an <intent-filter> to the <activity> you want the link to open.
<activity android:name=".YourActivityName" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Define your custom scheme and host -->
<data android:scheme="your-app-scheme" android:host="your-host" />
</intent-filter>
</activity>
How to Use:
- Replace
your-app-schemewith a unique name (e.g.,myawesomeapp). - Replace
your-hostwith a path identifier (e.g.,profile,promo). - The deep link you would use in your Pushwoosh message would be
your-app-scheme://your-host(e.g.,myawesomeapp://profile).
2. Using Android App Links (HTTPS Links)
This method allows you to use standard https:// web links to open your app. This is more complex as it requires you to verify ownership of the web domain.
Configuration:
-
In
AndroidManifest.xml, configure the intent filter to handle HTTPS URLs from your domain:<activity android:name=".YourActivityName" android:exported="true"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <!-- Define the HTTPS scheme, your domain, and an optional path --> <data android:scheme="https" android:host="your.domain.com" android:pathPrefix="/product" /> </intent-filter> </activity> On your web server, you must host a Digital Asset Links file (
assetlinks.json) athttps://your.domain.com/.well-known/assetlinks.jsonto prove your app is associated with your domain. For more details, refer to the official Android Developer documentation on App Links.
Comments
0 comments
Please sign in to leave a comment.