How to disable Firebase in-app messaging browser redirection on android

305 Views Asked by At

I want to open a specific activity on-click of buttons in firebase in-app messaging, by default it is redirecting to the browser. I want to open relevant activity within my app itself if user clicks on action button. please suggest me how can I disable browser redirection.

1

There are 1 best solutions below

3
ΓDΛ On

Assuming again that you want to track which link a user clicked on a Card-style message, define a class that implements the messageClicked method per the FirebaseInAppMessagingClickListener interface, thereby providing you access to the in-app messaging Action object, which in turn exposes the URL in the link clicked by the user.

First, implement a click listener:

public class MyClickListener implements FirebaseInAppMessagingClickListener {

    @Override
    public void messageClicked(InAppMessage inAppMessage, Action action) {
        // Determine which URL the user clicked
        String url = action.getActionUrl(); // you can open the relevant screen.

        // Get general information about the campaign
        CampaignMetadata metadata = inAppMessage.getCampaignMetadata();

        // ...
    }

}