← 글 목록

notes

Android·iOS - Deep Link

App Links·Universal Links·커스텀 스키마 차이 정리.

푸시나 마케팅 링크에서 “앱 특정 화면으로 바로”가 필요해서 딥링크를 붙였다. 스키마 링크와 https App/Universal Links를 헷갈리지 말 것.

Android

Manifest:

<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.example.com" android:pathPrefix="/item"/>
</intent-filter>

assetlinks.json을 호스트에 올려 검증. Activity에서 intent.data 파싱.

iOS

Associated Domains (applinks:app.example.com) + apple-app-site-association 파일.

func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
    guard let url = userActivity.webpageURL else { return }
    // path로 라우팅
}

커스텀 스키마

myapp://item/1은 구현은 쉽지만 가로채기 위험이 있어, 가능하면 https 링크를 우선한다.

RN이면

React Navigation linking 설정에 prefixes·config 매핑. 네이티브 Manifest/Associated Domains는 여전히 필요.