Deeplinks allow you to redirect your users to a specific page in your app or an external web page when they click on a push notification or a CTA in an In-App message. They are also very handful to track your push and In-App campaigns.
If you don't know how to use deeplinks or how they work, you can check this article:
Basic functioning
When your users open a push notification with a deeplink, Batch's SDK transfers the payload of the notification, which includes the deeplink, to the app. The app then handles the redirection to the associated page.
According to the deeplink structure in your app, your deeplinks will look different. There are two types of deeplinks:
A URI Scheme: based on a scheme and an optional path.
E.g.: myapp://path/to/content/
A URL: a classic website URL.
E.g.: https://myapp.com/path/to/content/
It varies depending on the OS:iOS: Universal Links.
Android: Android app links.
Testing the deeplink redirection
Here is how to test if a deeplink included in a push is handled properly by your app:
Go to the Batch dashboard and create a new push campaign
Enter a message for your push
Go to the Advanced settings and insert your deeplink in the deeplink field
Open the push notification on your device
Make sure that you are redirected to the right page. If not, please see the Troubleshooting part below.
Troubleshooting
Knowing that the redirection is handled by your app, the first step is to verify that the URL format is correct: for instance, a character might be missing.
If you are using a tracking parameter, remove it to test the deeplink itself.
If the format is correct but the deeplink redirection is still not working properly, here are some suggestions to find the issue:
My deeplink opens a web page instead of my app
In case of an In-App / Mobile Landing CTA, make sure that you selected the right option:
(iOS) If you are using Universal Links, the OS may always redirect to the browser because:
Batch SDK ≥ 1.18: the domain associated with the deeplink was not declared in your Associated Domains Entitlement file.
Batch SDK < 1.18: no deeplink delegate has been implemented in the application to define a different redirection behaviour.
Please refer to our technical documentation: iOS
My deeplink doesn't work at all
iOS
A. I'm using another push SDK in my app (e.g. Firebase)
Firebase (or another SDK) could intercept the push and its payload, and the deeplink would not be passed correctly to the application.
If this is the case, the "direct opens" of your push campaigns should be stuck at 0, and no log would be displayed in the console by the Batch SDK when you click on a push.
Please refer to this article: Preventing Firebase from Intercepting Batch push notifications.
B. I'm using a URI scheme
The deeplink used may not be part of the URI scheme declared in the app (a syntax error could be the cause of the problem).
Please refer to your app code, where the URI scheme is defined.
C. I'm using a deeplink delegate
URI scheme
The deeplink delegate may not be properly implemented and does not handle redirection correctly.
For instance, the URI scheme might not be correctly passed (manually) to [UIApplication openURL:].
Please refer to our technical documentation: Deeplinking.
Universal Links
Make sure that enableAutomaticDeeplinkHandling is not set to false, which would deactivate the deeplink delegate which is necessary to manage universal links on iOS.Otherwise, the deeplink delegate may not be properly implemented and does not handle redirection correctly.
Please refer to our technical documentation: Deeplinking.
Android
A. I didn't integrate Batch in all the activities of my app
Batch may not be integrated into all activities of the app. When a push is opened, the payload might not be passed to the Batch SDK, because it isn't started in the activity that was opened.
You can verify if the direct opens are tracked via the Batch logs: How to check Batch logs on Android? If no direct open is tracked by the Batch SDK, Batch might not be integrated in the activity.
In this case, you will need to integrate Batch into every activity of your app.
B. I'm using a URI scheme
The deeplink might not be part of the scheme declared in the app manifest (a syntax error may be the cause of the problem).
Please refer to your manifest in your app code.
C. I'm using a deeplink interceptor
The deeplink interceptor may not be properly implemented and does not handle redirection correctly.
Please refer to our technical documentation: Deeplinking.