javaandroidfirebasefirebase-in-app-messaging

how to customize firebase in-app messaging messages in android?


I've tried to customize firebase in-app messaging to change layout of the messages, but I failed it.

I followed documents in firebase - https://firebase.google.com/docs/in-app-messaging/customize-messages but couldn't understand what it means. It's little bit confusing.

In documentation, it seems quite easy. First, write my own FirebaseInAppMessagingDisplay class and register this to headless firebase In-App messaging sdk.

I tried in 2 ways.

First, import firebase in app messaging display module in android studio project. But gradle error occured.

next, I tried to make my own in-app messaging display class, but also failed.

on my knowledge, I need more reference but I can't find it.

I need some help!


Solution

  • U Should create your own FirebaseInAppMessageDisplay class by implementing

    FirebaseInAppMessagingDisplay, Application.ActivityLifecycleCallbacks
    

    like below https://github.com/firebase/firebase-android-sdk/blob/master/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/FirebaseInAppMessagingDisplayImpl.java

    InAppMessage Object will receive as a parameter in the DisplayMessage callback method

    InAppMessage Object will consist of title, body,imageUrl,campaignId,campaignName

    Using BindingWrapper u can create your own layout

    Press Ctrl + N navigate to FirebaseInAppMessaging Display class for more reference (com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay )

    For Reference

    https://firebase.google.com/docs/in-app-messaging/customize-messages?platform=android