LoginSignup
2
0

More than 1 year has passed since last update.

AndroidでNavigationを使ったDeep Linkの実装Part1

Last updated at Posted at 2022-12-01

初めに

今回から、Navigationを使ったDeepLinkの実装を紹介していこうと思います

本文

まずは、Manifestの書き方からです
schemeはその名の通りスキームを設定します。
何も書かなかった場合はhttphttpsが適用されます
hostには送られてくるurlの頭部分を指定します
pathPrefixはurlに含まれるパスを指定します。
指定のパスが含まれてない場合は無効になります。
完全一致で指定したい場合はpathPatternを使いましょう。

<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:host="domain"
        android:pathPrefix="/deeplinks"
        android:scheme="https" />
</intent-filter>

上記の設定の場合
https://domain/deeplinksから始まるurlが踏まれた場合に対象のアプリが開かれるようになります

最後に

今回は基本の基本であるManifestの書き方から紹介していきました
Part2は下記になります
https://qiita.com/ryuji_sato/items/db6de3e447f83726a732

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0