Skip to content

FirebaseInAppMessagingDisplay implementation improvements #4717

Open
@bartek-wesolowski

Description

@bartek-wesolowski

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:

  1. 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.
  2. Even though FirebaseInAppMessagingDisplay (the class) implements FirebaseInAppMessagingDisplay (the interface), its displayMessage() method doesn't do anything because it's inherited from FirebaseInAppMessagingDisplayImpl where this method is empty. displayMessage() should be implemented correctly in FirebaseInAppMessagingDisplay (the class).
  3. 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 of FirebaseInAppMessagingDisplay (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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions