App Link ์ค์
App Link๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์ Android Studio์ App Links Assistant๊ธฐ๋ฅ์ ์ด์ฉํด Digital Asset Links file ์ ์์ฑํ ํ ์ฝ๋๋ฅผ ์์ด์ฆํธ๋์ปค ์๋น์ค์ ์ ์ฉํด์ผ ํฉ๋๋ค.
Android Studio์ Tools ๋ฉ๋ด๋ฅผ ํด๋ฆญํ ํ App Links Assistant๋ฅผ ํด๋ฆญํฉ๋๋ค. ์ฐ์ธก์ App Links Assistant ํจ๋์ด ์คํ๋ ๊ฒ์ ํ์ธํฉ๋๋ค.
์ฐ์ธก ํจ๋์์ Open URL Mapping Editor ๋ฒํผ์ ํด๋ฆญํ์ฌ Host์ Path๋ฑ์ ์๋์ ์ด๋ฏธ์ง๋ฅผ ์ฐธ๊ณ ํ์ฌ ์์ฑํฉ๋๋ค. Path์ 102 ๋์ ์ฑ ๋งํฌ๋ฅผ ์ฌ์ฉํ ์๋น์ค์ ์๋น์ค๋ฒํธ๋ฅผ ๋ฃ์ด์ฃผ์ธ์.
OK๋ฒํผ์ ๋๋ฅด๊ณ main/AndroidManifest.xmlํ์ผ์ ์ ๋ ฅํ ์ ๋ณด๊ฐ ์ ํํ๊ฒ ์ ๋ ฅ ๋์๋์ง ํ์ธํฉ๋๋ค.
<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>์ฐ์ธก ํจ๋์์ Open Digital Asset Links File Generator ๋ฒํผ์ ํด๋ฆญํ ํ Preview์์ญ์ ์ ๊ณต๋๋ ์ฝ๋๋ฅผ ๋ณต์ฌํฉ๋๋ค.
๋ณต์ฌํ ์ฝ๋๋ฅผ ์์ด์ฆํธ๋์ปค ์๋น์ค ์ค์ > ์ดํ๋ฆฌ์ผ์ด์ ์ค์ > ๋ฒ์ฉ ๋งํฌ ์ค์ ์ ์๋๋ก์ด๋ App Link์ ์ฒจ๋ถ๋ ์ด๋ฏธ์ง์ ๊ฐ์ด ๋ถ์ฌ๋ฃ์ต๋๋ค.
์ฑ ๋งํฌ๋ฅผ ์์ ํ๋ Activity์ onCreate ํจ์์์ SDK์ ์คํ๋ url์ ์ค์ ํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ parseAppLinkToGetDeeplinkUr ํจ์๋ฅผ ํตํด์ ์ฌ์ฉ์๊ฐ ์ด๋ํ ๋ฅ๋งํฌ ๊ฒฝ๋ก๋ฅผ ๋ฐํ๋ฐ์ ํ๋ฉด ์ด๋์ ์ฒ๋ฆฌํฉ๋๋ค.
@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 ๊ฐ์ผ๋ก ๋ฐํ๋ ์์น๋ก ์ฑ ํ๋ฉด ์ด๋ ์ฒ๋ฆฌ.
}
}
}
}Last updated
Was this helpful?