디퍼드 딥링킹을 사용하면 앱을 설치하지 않은 사용자가 Adjust 링크를 클릭하여 앱 스토어에서 앱을 설치한 후, 처음 앱을 열 때 원하는 콘텐츠로 이동할 수 있습니다.
작동 방식
다음은 디퍼드 딥링킹의 기본 흐름입니다.
사용자가 Adjust 딥링크를 클릭합니다.
Adjust 서버가 사용자를 앱 스토어로 리다이렉트합니다.
사용자가 앱을 설치 또는 재설치하고, 실행합니다.
Adjust SDK가 /session 요청과 /attribution 요청을 Adjust 서버로 전송합니다.
Adjust 서버가 클릭을 설치 또는 재설치와 매칭하고, 다음 응답 중 하나에서 디퍼드 딥링크를 SDK에 반환합니다.
Adjust SDK는 디퍼드 딥링크 수신자를 통해 디퍼드 딥링크를 앱에 전달합니다.
해당되는 경우, 앱은 온보딩 화면 및 사용자 로그인 화면 같은 초기 화면을 표시합니다.
앱이 딥링크를 처리하여 적절한 화면으로 이동합니다.
사용자가 Adjust 브랜드 링크(brandname.go.link)를 클릭하고 링크가 디퍼드되면 Adjust 서버는 Adjust 대시보드의 Android 플랫폼 설정에서 구성된 APP SCHEME을 사용하여 해당 링크를 APP SCHEME 형식(example://)으로 변환한 후 Adjust SDK로 전달합니다.
설정
디퍼드 딥링크 수신자 설정
AdjustConfig 객체를 생성합니다.
AdjustConfig 객체에 디퍼드 딥링크 수신자를 설정합니다. Adjust SDK는 디퍼드 딥링크를 수신한 후 이 수신자를 호출합니다.
SDK를 초기화합니다.
val appToken = "{YourAppToken}"
val environment = AdjustConfig.ENVIRONMENT_SANDBOX
val config = AdjustConfig ( this , appToken, environment)
config. setOnDeferredDeeplinkResponseListener { deeplink: Uri ? ->
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link
* (for example, store it or handle it immediately)
false // or true based on your use case (see below)
String appToken = "{YourAppToken}" ;
String environment = AdjustConfig.ENVIRONMENT_SANDBOX;
AdjustConfig config = new AdjustConfig ( this , appToken, environment);
config. setOnDeferredDeeplinkResponseListener ( new OnDeferredDeeplinkResponseListener () {
public boolean launchReceivedDeeplink (Uri deeplink ) {
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link
* (for example, store it or handle it immediately)
return false ; // or true based on your use case (see below)
반환 값 옵션
디퍼드 딥링크 수신자의 반환 값에 따라 수신자 코드가 실행된 이후의 작업이 결정됩니다.
false 반환(가장 일반적)
앱에서 디퍼드 딥링크를 처리하는 시점과 방법을 완전히 제어하려면 이 방법을 사용합니다. false를 반환하면 Adjust SDK는 디퍼드 딥링크를 열려고 시도하지 않습니다. 예를 들어, 앱이 초기 화면(예: 온보딩 또는 로그인)을 먼저 표시하고 그 이후에 디퍼드 딥링크를 처리해야 하는 경우 이 접근 방식이 적합합니다.
반환 true
수신자 코드가 실행된 직후 Adjust SDK가 디퍼드 딥링크를 열도록 하려면 이 방법을 사용합니다. 예를 들어, 앱에 초기 화면이 없는 경우 이 접근 방식이 적합합니다.
Adjust SDK가 디퍼드 딥링크를 수신하면 수신자 코드가 실행되고, Adjust SDK가 디퍼드 딥링크와 함께 startActivity(Intent) 를 호출합니다.
전체 코드 예시
본 예시는 온보딩 프로세스가 있는 앱이 디퍼드 딥링크를 어떻게 처리하는지 보여줍니다.
앱의 내부 흐름을 요약하면 다음과 같습니다.
사용자가 앱을 실행하고, 디퍼드 딥링킹이 적용됩니다.
앱이 온보딩 프로세스를 시작합니다.
앱의 수신자가 Adjust SDK로부터 디퍼드 딥링크를 수신하고, 온보딩 프로세스가 완료되었는지 확인합니다.
온보딩이 완료되면 즉시 딥링크를 처리합니다.
온보딩이 완료되지 않은 경우 딥링크를 저장합니다.
온보딩이 완료되면 앱은 저장된 모든 디퍼드 딥링크를 확인하고 처리합니다.
앱이 사용자를 딥링크 화면으로 이동시킵니다.
class MainActivity : AppCompatActivity () {
private lateinit var sharedPreferences: SharedPreferences
override fun onCreate (savedInstanceState: Bundle ?) {
super . onCreate (savedInstanceState)
sharedPreferences = getSharedPreferences ( "adjust_prefs" , Context.MODE_PRIVATE)
val appToken = "{YourAppToken}"
val environment = if (BuildConfig.DEBUG) AdjustConfig.ENVIRONMENT_SANDBOX else AdjustConfig.ENVIRONMENT_PRODUCTION
val config = AdjustConfig ( this , appToken, environment)
config. setLogLevel ( if (BuildConfig.DEBUG) LogLevel.VERBOSE else LogLevel.SUPPRESS)
// Receive deferred deep link via listener
config. setOnDeferredDeeplinkResponseListener { deeplink: Uri ? ->
return @setOnDeferredDeeplinkResponseListener false
val hasCompletedOnboarding = sharedPreferences. getBoolean ( "has_completed_onboarding" , false )
if (hasCompletedOnboarding) {
// If onboarding is complete, handle deferred deep link immediately
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link and navigate to the appropriate screen.
// Store deferred deep link to invoke after onboarding screens and login
. putString ( "deferred_link" , deeplink. toString ())
// The app controls when and how it handles the deferred deep link, so return false.
val hasCompletedOnboarding = sharedPreferences. getBoolean ( "has_completed_onboarding" , false )
if (hasCompletedOnboarding) {
// Show onboarding screens and login prompt
// This logic runs when the user finishes the onboarding flow
fun onOnboardingFinished () {
// Set hasCompletedOnboarding to true
sharedPreferences. edit (). putBoolean ( "has_completed_onboarding" , true ). apply ()
// Check for deferred deep link received before or during onboarding
// Exit if no deferred deep link was stored
val deferredLinkString = sharedPreferences. getString ( "deferred_link" , null ) ?: return
// Remove the stored deep link to prevent it from being handled again
sharedPreferences. edit (). remove ( "deferred_link" ). apply ()
// Convert the stored string back to a Uri object
val deeplink = Uri. parse (deferredLinkString)
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link and navigate to the appropriate screen.
public class MainActivity extends AppCompatActivity {
private SharedPreferences sharedPreferences;
protected void onCreate (Bundle savedInstanceState ) {
super . onCreate (savedInstanceState);
sharedPreferences = getSharedPreferences ( "adjust_prefs" , Context.MODE_PRIVATE);
String appToken = "{YourAppToken}" ;
String environment = BuildConfig.DEBUG ? AdjustConfig.ENVIRONMENT_SANDBOX : AdjustConfig.ENVIRONMENT_PRODUCTION;
AdjustConfig config = new AdjustConfig ( this , appToken, environment);
config. setLogLevel (BuildConfig.DEBUG ? LogLevel.VERBOSE : LogLevel.SUPPRESS);
// Receive deferred deep link via listener
config. setOnDeferredDeeplinkResponseListener ( new OnDeferredDeeplinkResponseListener () {
public boolean launchReceivedDeeplink (Uri deeplink ) {
boolean hasCompletedOnboarding = sharedPreferences. getBoolean ( "has_completed_onboarding" , false );
if (hasCompletedOnboarding) {
// If onboarding is complete, handle deferred deep link immediately
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link and navigate to the appropriate screen.
// Store deferred deep link to invoke after onboarding screens and login
. putString ( "deferred_link" , deeplink. toString ())
// The app controls when and how it handles the deferred deep link, so return false.
boolean hasCompletedOnboarding = sharedPreferences. getBoolean ( "has_completed_onboarding" , false );
if (hasCompletedOnboarding) {
// Show onboarding screens and login prompt
// This logic runs when the user finishes the onboarding flow
private void onOnboardingFinished () {
// Set hasCompletedOnboarding to true
sharedPreferences. edit (). putBoolean ( "has_completed_onboarding" , true ). apply ();
// Check for deferred deep link received before or during onboarding
// Exit if no deferred deep link was stored
String deferredLinkString = sharedPreferences. getString ( "deferred_link" , null );
if (deferredLinkString == null ) {
// Remove the stored deep link to prevent it from being handled again
sharedPreferences. edit (). remove ( "deferred_link" ). apply ();
// Convert the stored string back to a Uri object
Uri deeplink = Uri. parse (deferredLinkString);
* example://summer-clothes?promo=beach&adj_t=def456
* TODO: Handle the deep link and navigate to the appropriate screen.