Deeplink
If you are using an Adtrace tracker URL with the option to deep link into your app, there is the possibility to get information about the deep link URL and its content. Hitting the URL can happen when the user has your app already installed (standard deep linking scenario) or if they don't have the app on their device (deferred deep linking scenario). In the standard deep linking scenario, the Android platform natively offers the possibility for you to get the information about the deep link content. The deferred deep linking scenario is something which the Android platform doesn't support out of the box, and, in this case, the Adtrace SDK will offer you the mechanism you need to get the information about the deep link content.
You need to set up deep linking handling in your app on native level - in your generated Xcode project (for iOS) and Android Studio (for Android).
Standard scenario
Unfortunately, in this scenario the information about the deep link can not be delivered to you in your Dart code. Once you enable your app to handle deep linking, you will get information about the deep link on native level. For more information check our chapters below on how to enable deep linking for Android and iOS apps.
Deferred scenario
In order to get information about the URL content in a deferred deep linking scenario, you should set a callback method on the config object which will receive one string parameter where the content of the URL will be delivered. You should set this method on the config object by assigning the deferredDeeplinkCallback member:
AdTraceConfig adtraceConfig = new AdTraceConfig(yourAppToken, environment);
adtraceConfig.deferredDeeplinkCallback = (String? uri) {
print('[AdTrace]: Received deferred deeplink: ' + uri!);
};
AdTrace.start(adtraceConfig);
In deferred deep linking scenario, there is one additional setting which can be set on the config object. Once the Adtrace SDK gets the deferred deep link information, we offer you the possibility to choose whether our SDK should open this URL or not. You can choose to set this option by assigning the launchDeferredDeeplink member of the config instance:
AdTraceConfig adtraceConfig = new AdTraceConfig(yourAppToken, environment);
adtraceConfig.launchDeferredDeeplink = true;
adtraceConfig.deferredDeeplinkCallback = (String uri) {
print('[AdTrace]: Received deferred deeplink: ' + uri);
};
AdTrace.start(adtraceConfig);
If nothing is set, the Adtrace SDK will always try to launch the URL by default.
To enable your apps to support deep linking, you should set up schemes for each supported platform.
Deep linking handling in Android app
This should be done in native Android Studio / Eclipse project.
To set up your Android app to handle deep linking on native level, please follow our guide in the official Android SDK README.
Deep linking handling in iOS app
This should be done in native Xcode project.
To set up your iOS app (Runner project) to handle deep linking on native level, please follow our guide in the official iOS SDK README.