0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

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

Last updated at Posted at 2022-12-26

初めに

今回は届いた通知からDeep Linkを取り出す方法を紹介していきます

本文

FirebaseMessagingServiceを継承したクラス内部で下記のように実装することでFcmから受け取った通知に入っているDeepLinkを取得することができます。
ついでに、通知のタイトルやメッセージの取得方法も載せておきます

override fun onMessageReceived(remoteMessage: RemoteMessage) {
        val deepLink = remoteMessage.data[PAYLOAD_NAME] ?: return null
        val title = remoteMessage.notification?.title ?: return
        val body = remoteMessage.notification?.body ?: return
    }

最後に

今回は、届いた通知に入っているDeepLinkの取得方法を紹介しました
次回の記事は追加次第リンクを貼り付けようと思ってるのでぜひご活用ください
Part1は下記の記事になります
https://qiita.com/ryuji_sato/items/a54a0530065637be1fa1
Part3は下記の記事になります
https://qiita.com/ryuji_sato/items/5cfe994cfe1fbe0c5976

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?