firebase-android-sdk: 159135253: Trigger FirebaseInAppMessagingClickListener. messageClicked when action is empty
What feature would you like to see?
Invoke FirebaseInAppMessagingClickListener.messageClicked for use case when you don’t want to trigger browser intent and you are interested only to handle other data (such as key-value map defined in the campaign)
As a user, I don’t want to trigger any URL specific browser intent when i click my In App Message popup. I want to trigger below code without any side effects:
inAppMessaging.addClickListener { inAppMessage, action ->
// invoke only code inside
val data = inAppMessage.data // I am only interested in that data, don't want to trigger any browser intent
}
Unfortunately, this listener is not being invoked when the defined action is empty. You must define the action with proper URL to be able to trigger this listener when popup is clicked.
Can we trigger such listener always when the popup is being clicked, even when the defined action for campaign is empty?
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 20 (10 by maintainers)
The above change should improve a few things
Hi @JasonAHeron thanks for the quick response. Firebase InAppMessaging should not send Intent with custom scheme of data. Now I am trying to set button action like myAppId://sceenA, myAppId://sceenB, myAppId://sceenC. After trigger action by the user, I want only to change a screen inside the app. Now my app crashing: No Activity found to handle Intent { act=android.intent.action.VIEW dat=myAppId://sceenA (has extras) } FirebaseInAppMessagingClickListener should provide the option to disable the sending of intent or give a possibility to override this default behavior. In my case sending Intent is not needed. The same problem is when I want to open the Uri inside my app in WebView instead of the external browser.
Hey folks, thanks for bringing this back to my attention. I’m going to prioritize this this week and hopefully have a fix in the next release.
The feature that we are talking about is a dismissal event. I have checked the documentation for iOS and in the CardActionFiamDisplay there is a messageDismissed listener: https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=ios#implement_a_displaydelegate_to_handle_card_interactions As far I as understand, the same functionality on android would resolve the issue. Why these two even do not share the same functionalities? 😦
Okay so this is a request for something like “Prevent Default” on click listeners. Makes sense. I’ll bundle it into the proposal for click behavior changes
@JasonAHeron I can confirm that your description is something that I am looking for.
In addition, my use case is to trigger an InAppMessaging popup and after click on it change the Fragment in my activity without any current activity refresh. To achieve that I think I must not trigger any deeplink related browser intent. The easiest way would be to handle such scenario in the FirebaseInAppMessagingClickListener. messageClicked as I proposed (without any side effects) I don’t see any possible reason to use FirebaseMessaging in that case as @ashwinraghav proposed.
@ashwinraghav @JasonAHeron Can we reopen this feature request?