Deep links are URIs (Uniform Resource Identifiers) that direct users to specific pages within your app. They improve the user experience by guiding them directly to relevant content after they interact with a link.
Adobe AIR SDK supports two types of deep links, based on whether the user has already installed your app:
- Direct deep links: If the user already has your app installed, the link opens the specified page.
- Deferred deep links: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens in the specified page.
Configure your app
Reattribution with direct deep links
You can reattribute your users by sending deep link information to Adjust. When a user interacts with the deep link, the SDK sends this data to Adjust to update their attribution information.
First, create a new
AdjustDeeplink
instance with your deep link URI. TheAdjustDeeplink
class validates this URI and checks the formatted string to ensure successful processing.Then, call the
Adjust.processDeeplink
method to handle the deep link and pass the information to Adjust.
The AdjustDeeplink
class constructor requires the following argument:
deeplink
:Uri
The deep link URI that opens your app.
The Adjust.processDeeplink
method requires the following argument:
adjustDeeplink
:AdjustDeeplink
The
AdjustDeeplink
instance you created.
To get information via a direct deep link, subscribe to the InvokeEvent.INVOKE
event and set up a callback method that's triggered once this event happens. You can access the URL of the deep link that opened your app inside that callback method:
var app:NativeApplication = NativeApplication.nativeApplication;app.addEventListener(InvokeEvent.INVOKE, onInvoke);
// ...
private static function onInvoke(event:InvokeEvent):void { if (event.arguments.length == 0) { return; }
var deeplink:String = event.arguments[0]; trace("Deeplink = " + deeplink); var adjustDeeplink:AdjustDeeplink = new AdjustDeeplink(deeplink); Adjust.processDeeplink(adjustDeeplink);}
Deferred deep link callbacks
To get information via a deferred deep link, you set a callback method on the AdjustConfig
instance. This receives a String
parameter where the content of the URL will be delivered.
- Call
setDeferredDeeplinkCallback
method on youradjustConfig
instance. - Pass the deep link as a
String
.
The setDeferredDeeplinkCallback
method requires the following arguments:
setDeferredDeeplinkCallback
:setDeferredDeeplinkCallback
A function that sets a deferred deep link callback.
deeplink
:String
The deferred deep link you want to pass.
var appToken:String = "{YourAppToken}";var environment:String = AdjustEnvironment.SANDBOX;
var adjustConfig:AdjustConfig = new AdjustConfig(appToken, environment);adjustConfig.setDeferredDeeplinkCallback(DeferredDeeplinkCallback);Adjust.initSdk(adjustConfig);
// ...
private static function DeferredDeeplinkCallback(deeplink:String):void { trace("Received deferred deep link"); trace("Deep link = " + deeplink);};
Disable opening deferred deep links
The SDK opens deferred deep links by default. You can disable this behavior with the disableDeferredDeeplinkOpening
method.
- Call
disableDeferredDeeplinkOpening
on youradjustConfig
instance.
adjustConfig.disableDeferredDeeplinkOpening();
Adapat and add snippets See template: Adobe Extension tutorial
Tutorial: Create a deferred deep link function
If you followed the integration guide, you've already configured the Adjust AIR SDK to process and open deep links. If you haven't done this, refer to set up deep link handling for instructions.
In this tutorial, you'll learn how to create a callback function that controls deep linking functionality using the setDeferredDeeplinkCallback
method. The function will open the link depending on the following condition:
"If the deep link contains "no_open"
, the app won't open it."
The result looks like this:
package { import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustConfig; import com.adjust.sdk.AdjustEnvironment; import com.adjust.sdk.AdjustLogLevel;
public class Example extends Sprite { public function Example() { var appToken:String = "{YourAppToken}"; var environment:String = AdjustEnvironment.SANDBOX;
var adjustConfig:AdjustConfig = new AdjustConfig(appToken, environment); adjustConfig.setLogLevel(AdjustLogLevel.VERBOSE);
adjustConfig.setDeferredDeeplinkCallback(DeferredDeeplinkCallback);
Adjust.initSdk(adjustConfig); } }
private static function deferredDeeplinkDelegate(uri:String):void { trace("Received deferred deeplink"); trace("URI = " + uri); }
}
Here's what you need to do:
Inside the
try...catch
block, call thesetDeferredDeeplinkCallback
method of youradjustConfig
instance. Pass anOnDeferredDeeplinkResponseListener
instance as an argument.Main.as // add snippetCreate a new public function called
launchReceivedDeeplink
inside yourOnDeferredDeeplinkResponseListener
declaration. This method takes aUri
argument and returns aboolean
.Main.as // add snippetAdd an
if
condition to thelaunchReceivedDeeplink
to check if thedeeplink
contains the value"no_open"
. If the string is found, the function returnsfalse
, and the app shouldn't open the deferred deep link.Main.as // add snippetFinally, add an
else
block to returntrue
if the deep link doesn't contain"no_open"
.Main.as // add snippet
That's it! When a user opens your app with a deferred deep link, the Adobe AIR SDK will check if the link contains the string "no_open"
. If it does, the app won't open the deep link.