I am trying to customise the firebase in-app messages.
I am following this article :https://firebase.google.com/docs/in-app-messaging/customize-messages
As per the article I have created my own implementation of FirebaseInAppMessagingDisplay class.
import com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplay;
import com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplayCallbacks;
import com.google.firebase.inappmessaging.model.InAppMessage;
public class MyMessageDisplayImplementation implements
FirebaseInAppMessagingDisplay {
@Override
public void displayMessage(InAppMessage inAppMessage
, FirebaseInAppMessagingDisplayCallbacks
firebaseInAppMessagingDisplayCallbacks) {
Log.e("INAPP_MESSAGE","received an inapp message");
}
}
Then registered this implementation with the headless Firebase In-App Messaging SDK
public class MyApplication extends Application{
@Override
public void onCreate() {
super.onCreate();
FirebaseInAppMessaging.getInstance().setMessageDisplayComponent(new MyMessageDisplayImplementation());
}
}
My problem is that, I am not getting the displyaMessage() callback.
When I commented out the line of code, " FirebaseInAppMessaging.getInstance().setMessageDisplayComponent(new MyMessageDisplayImplementation());"
from Application class, it is showing the default message. But, nothing is happening when I put this code back.
Please help if anyone knows better idea about this in-app message customisation.