# App Link 설정

App Link를 사용하기 위해선 Android Studio의 App Links Assistant기능을 이용해 Digital Asset Links file 을 생성한 후 코드를 와이즈트래커 서비스에 적용해야 합니다.

* Android Studio의 Tools 메뉴를 클릭한 후 App Links Assistant를 클릭합니다.  우측에 App Links Assistant 패널이 오픈된 것을 확인합니다.

![](/files/-M_Zvd57MMd-mtwG8L1z)

* 우측 패널에서 Open URL Mapping Editor 버튼을 클릭하여 Host와 Path등을 아래의 이미지를 참고하여 작성합니다. Path의 102 대신 앱 링크를 사용할 서비스의 서비스번호를 넣어주세요.

![](/files/-M_ZwDjCI42pMvh9mP6T)

* OK버튼을 누르고 main/AndroidManifest.xml파일에 입력한 정보가 정확하게 입력 되었는지 확인합니다.

{% tabs %}
{% tab title="XML" %}

```markup
<intent-filter android:autoVerify="true">
 <action android:name="android.intent.action.VIEW" /> 
 <category android:name="android.intent.category.DEFAULT" />
 <category android:name="android.intent.category.BROWSABLE" /> 
 <!-- 앱링크로 진입될 스키마와 호스트 정보 설정 -->
 <data android:scheme="https"
       android:host="app.wisetracker.co.kr"
       android:pathPattern="/ul/102/"
      /> 
</intent-filter>
```

{% endtab %}
{% endtabs %}

* 우측 패널에서 Open Digital Asset Links File Generator 버튼을 클릭한 후 Preview영역에 제공되는 코드를 복사합니다.

![](/files/-M_ZwcWFNruGz1YqmRPJ)

* 복사한 코드를 와이즈트래커 서비스 설정 > 어플리케이션 설정 > 범용 링크 설정의 안드로이드 App Link에 첨부된 이미지와 같이 붙여넣습니다.

![](/files/-M_ZwjAQr1zE2FbdYx2_)

* 앱 링크를 수신하는 Activity의 onCreate 함수에서 SDK에 실행된 url을 설정합니다. 그리고 parseAppLinkToGetDeeplinkUr 함수를 통해서 사용자가 이동할 딥링크 경로를 반환받아 화면 이동을 처리합니다.

{% tabs %}
{% tab title="Java" %}

```java
@Override
protected void onCreate(Bundle savedInstanceState) {
     if( getIntent() != null ){
         // 앱 실행 경로 설정 
         DOT.setDeepLink(getApplicationContext(),getIntent());
         Uri uri = getIntent().getData();
         if(uri != null){
             // 앱 링크를 통해서 앱이 실행된 경우에 이동할 딥링크 주소 반환 
             String deepLinkUrlFromApplink = DOT.parseAttributionLinkToGetDeeplinkUrl(uri.toString());
             if(deepLinkUrlFromApplink != null && !deepLinkUrlFromApplink.equals("")){
                 // deepLinkUrlFromApplink 값으로 반환된 위치로 앱 화면 이동 처리. 
             }
         } 
     }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://document.wisetracker.co.kr/v2-developer/sdk/android/app-link.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
