Comprehensive guide to setting up deep linking for Android, iOS, email, push notifications, and in-app messaging using OneSignal.
Deep linking allows you to open a specific page within your app from an external source such as a website, email, or SMS. If the app is not installed, users are redirected to the appropriate app store. If on an unsupported platform, users are redirected to a fallback website.
This guide covers setup and usage of deep linking across:
To function correctly, deep links must:
Use Android Studio’s App Links Assistant to simplify setup.
assetlinks.json
fileThe generated assetlinks.json
file must be hosted at:
Use Android Studio’s App Links Assistant to simplify setup.
assetlinks.json
fileThe generated assetlinks.json
file must be hosted at:
Apple supports Universal Links and URL Schemes.
applinks:yourdomain.com
OneSignal’s iOS SDK uses openURL
for Launch URL
. This redirects to browser first, then back into app.
To suppress this:
data
instead of url
in APIOneSignal_suppress_launch_urls
to Info.plist
as a Boolean with value YES
More Infoapple-app-site-association
JSON at:Example file:
Include the deep link as:
url
property (Launch URL)data
property (recommended for iOS to suppress browser redirect)Behavior:
Include the deep link as:
url
property (Launch URL)data
property (recommended for iOS to suppress browser redirect)Behavior:
By default, email links use OneSignal’s tracking, which alters the URL and breaks deep linking.
disable_email_click_tracking: true
in APITrack link clicks is disabled.
Tradeoff:
Scenario | Result |
---|---|
iOS + Safari + Universal Link + Tracking Enabled | Opens Safari, asks to open app |
iOS + Safari + Universal Link + Tracking Disabled | Opens app directly |
iOS + Non-Safari + Universal Link | Opens App Store |
Android + Universal Link or App Link | May open App Store if not installed |
Android + App Link + Tracking Disabled | Opens app directly |
Android + App Link + Tracking Enabled | Opens browser first, then app |
Comprehensive guide to setting up deep linking for Android, iOS, email, push notifications, and in-app messaging using OneSignal.
Deep linking allows you to open a specific page within your app from an external source such as a website, email, or SMS. If the app is not installed, users are redirected to the appropriate app store. If on an unsupported platform, users are redirected to a fallback website.
This guide covers setup and usage of deep linking across:
To function correctly, deep links must:
Use Android Studio’s App Links Assistant to simplify setup.
assetlinks.json
fileThe generated assetlinks.json
file must be hosted at:
Use Android Studio’s App Links Assistant to simplify setup.
assetlinks.json
fileThe generated assetlinks.json
file must be hosted at:
Apple supports Universal Links and URL Schemes.
applinks:yourdomain.com
OneSignal’s iOS SDK uses openURL
for Launch URL
. This redirects to browser first, then back into app.
To suppress this:
data
instead of url
in APIOneSignal_suppress_launch_urls
to Info.plist
as a Boolean with value YES
More Infoapple-app-site-association
JSON at:Example file:
Include the deep link as:
url
property (Launch URL)data
property (recommended for iOS to suppress browser redirect)Behavior:
Include the deep link as:
url
property (Launch URL)data
property (recommended for iOS to suppress browser redirect)Behavior:
By default, email links use OneSignal’s tracking, which alters the URL and breaks deep linking.
disable_email_click_tracking: true
in APITrack link clicks is disabled.
Tradeoff:
Scenario | Result |
---|---|
iOS + Safari + Universal Link + Tracking Enabled | Opens Safari, asks to open app |
iOS + Safari + Universal Link + Tracking Disabled | Opens app directly |
iOS + Non-Safari + Universal Link | Opens App Store |
Android + Universal Link or App Link | May open App Store if not installed |
Android + App Link + Tracking Disabled | Opens app directly |
Android + App Link + Tracking Enabled | Opens browser first, then app |