firebase / firebase/firebase-android-sdk

FIAM does not dismiss on back gesture when android:enableOnBackInvokedCallback is set to true

Open
#6,642 6 comments 4 reactions 0 assignees View on GitHub
api: inappmessaging type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

* Android Studio version: Android Studio Meerkat | 2024.3.1 Canary
* Firebase Component: InAppMessaging
* Component version: Bom33.7.0

Expected behavior:
• The FIAM message should be dismissed when the back gesture is performed.

Observed behavior:
• The FIAM message is not dismissed when the back gesture is performed.

#### Steps to reproduce:

1. Enable android:enableOnBackInvokedCallback in your app’s AndroidManifest.xml.
2. Display a Firebase In-App Messaging (FIAM) message.
3. Attempt to dismiss the FIAM message using the back gesture.

#### Relevant Code:

It seems the issue may be related to the BackButtonHandler implementation in the Firebase In-App Messaging SDK. Specifically, dispatchKeyEvent in BackButtonHandler might not be invoked when android:enableOnBackInvokedCallback is set to true, as the back gesture bypasses the traditional KeyEvent.KEYCODE_BACK handling.
https://github.com/firebase/firebase-android-sdk/blob/377edccb947d97000fde92999743f3981e89f6c5/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/layout/util/BackButtonHandler.java#L23

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.