Open
Description
What feature would you like to see?
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay
's implementation is weird. It would be nice to fix it. Here are the things that I think should be changed:
- The class name is the same as the name of the interface that it implements (
com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplay
). This makes things confusing. Importing an incorrect thing is easy. If you want to use both the interface and the class (e.g. when implementing your own implementation of message display that forwards to the default one in some cases) then it becomes even more cumbersome. - Even though
FirebaseInAppMessagingDisplay
(the class) implementsFirebaseInAppMessagingDisplay
(the interface), itsdisplayMessage()
method doesn't do anything because it's inherited fromFirebaseInAppMessagingDisplayImpl
where this method is empty.displayMessage()
should be implemented correctly inFirebaseInAppMessagingDisplay
(the class). FirebaseInAppMessagingDisplayImpl
mentioned in the previous point is a weird class that probably shouldn't exist. It does nothing except printing some logs on Activity lifecycle events. In particular, it doesn't provide the implementation ofFirebaseInAppMessagingDisplay
(the interface) that it implements.
I'm trying to implement my own FirebaseInAppMessagingDisplay
that forwards to the default implementation after checking some conditions. Calling displayMessage()
on the default implementation class doesn't work. I have to use the testMessage()
method which is a hacky use of that code. If the default implementation of FirebaseInAppMessagingDisplay
can't correctly implement the interface then doesn't it mean that the interface itself isn't that great either?