Adjust’s link shortener solution converts your complex and long links into cleaner and shorter links. The shortened links retain deep link and campaign information, and route users to the app store, if they don’t have your app installed.
Use the method described in this section to resolve your short links.
Set up deep linking in the Adjust SDK
In the Adjust SDK, add support for the following:
Set up the Adjust SDK to resolve short links
public static void processDeeplink(Uri url, Context context, OnDeeplinkResolvedListener callback)
The Adjust SDK delivers deep link information within your activity’s intent object using either the onCreate
or onNewIntent
method. The deep link is available on the data
property of the intent
object. You can access this deep link once the app is launched and one of these methods has fired. You can then call the processDeeplink
method to resolve the short Adjust link URL that deep linked users into your app.
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main)
val intent = intent val webpageURL = intent.data Adjust.processDeeplink(webpageURL, this) { resolvedLink -> // resolvedLink contains either resolved URL (if it was unshortened) // or just echoed URL if it was not shortened Log.d("Example", resolvedLink) }}
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent(); Uri webpageURL = intent.getData(); Adjust.processDeeplink(webpageURL, this, new OnDeeplinkResolvedListener() { @Override public void onDeeplinkResolved(String resolvedLink) { // resolvedLink contains either resolved URL (if it was unshortened) // or just echoed URL if it was not shortened Log.d("Example", resolvedLink); } });}
override fun onNewIntent(intent: Intent?) { super.onNewIntent(intent)
val webpageURL = intent.data Adjust.processDeeplink(webpageURL, this) { resolvedLink -> // resolvedLink contains either resolved URL (if it was unshortened) // or just echoed URL if it was not shortened Log.d("Example", resolvedLink) }}
@Overrideprotected void onNewIntent(Intent intent) { super.onNewIntent(intent);
Uri webpageURL = intent.getData(); Adjust.processDeeplink(webpageURL, this, new OnDeeplinkResolvedListener() { @Override public void onDeeplinkResolved(String resolvedLink) { // resolvedLink contains either resolved URL (if it was unshortened) // or just echoed URL if it was not shortened Log.d("Example", resolvedLink); } });}
In case the link you sent to processDeeplink
method was shortened, resolvedLink
returns the extended original link. In case the link you passed to the method wasn’t shortened, then resolvedLink
contains the same link you have passed.