Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kk-777-1127 opened this issue Jan 24, 2025 · 3 comments

Comments

@kk-777-1127
Copy link

kk-777-1127 commented Jan 24, 2025

  • 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.

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@lehcar09
Copy link
Contributor

Hi @kk-777-1127, thank you for reaching out. I was able to reproduce the issue. I'll raise this to our engineers and see what we can do here. I'll get back to you once I hear back from them. Thanks!

@kk-777-1127
Copy link
Author

The FiamFrameLayout component does not have direct knowledge of the associated Activity. This makes it challenging to implement features that rely on Activity, such as supporting predictive back gestures using OnBackInvokedDispatcher (introduced in Android 13).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants