1. 딥링크 URL을 직접 전달하는 방법
adb shell am start -W -a android.intent.action.VIEW -d "app://open?toWebView=https://xxx.xxxx.co.kr/intro" io.github.ovso.app
- 앱이 실행된 후 첫 화면의 intent 로부터 데이터를 받습니다.
- intent.data(Uri) 에 scheme, host를 포함한 모든 데이터가 들어 있습니다.
- intent.data.getQueryParameter("toWebView")로 데이터를 꺼냅니다.
2. 추가 데이터로 딥링크를 전달하는 방법
adb shell am start -W -a android.intent.action.VIEW -d "app://open" -e "toWebViewUrl" "https://xxx.xxxx.co.kr/intro" io.github.ovso.app
- 앱이 실행된 후 첫 화면의 intent 로부터 데이터를 받습니다.
- intent.data(Uri) 에 scheme, host 정보가 들어있습니다.
- intent.getStringExtra("toWebView")로 데이터를 꺼냅니다.
XML 정의
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="open" />
<data android:scheme="app" />
</intent-filter>
</activity>
TMI
adb shell am start -W -a android.intent.action.VIEW -d "app://open" -e "toWebViewUrl" "https://xxx.xxxx.co.kr/intro" io.github.ovso.app --activity-clear-top