LoginSignup
2
2

More than 3 years have passed since last update.

Firebase In-App MessagingをAndroidで実装してみてちょっとハマったこと

Last updated at Posted at 2019-06-19

問題

基本的にはこの公式Documentに従えば問題ないのですが、
一つだけ公式Documentに漏れがありました。
https://firebase.google.com/docs/android/setup?hl=ja
なのではじめてIn-App Messagingをアプリに入れようとすると公式Documentにしたがっても動きません。

この部分の漏れがあります。
https://firebase.google.com/docs/in-app-messaging/get-started?hl=ja&platform=android#add_the_sdk_to_your_project

dependencies {
    // ...

    // Add the In-App Messaging dependency:
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.1.0'

    // Check that Firebase core is up-to-date:
    implementation 'com.google.firebase:firebase-core:16.0.8'
}

↑ とgradleの設定が書かれているのですが、実際には com.google.firebase:firebase-inappmessaging も設定してあげないと動きません。 (公式Documentには com.google.firebase:firebase-inappmessaging-display だけ設定すれば行けるように書かれている。)

結論

dependencies {
    // ...

    // Add the In-App Messaging dependency:
    implementation 'com.google.firebase:firebase-inappmessaging:17.1.0'
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.1.0'

    // Check that Firebase core is up-to-date:
    implementation 'com.google.firebase:firebase-core:16.0.8'
}

と言うことで ↑ こうすれば動きます。

2
2
1

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
2