-
Notifications
You must be signed in to change notification settings - Fork 598
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
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! |
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). |
From what I gather, setting android:enableOnBackInvokedCallback=true turns on predictive back animations, and instructs the system to use the OnBackInvokedCallback platform API. The OnBackInvokedCallback platform API, replaces the KeyEvent.KEYCODE_BACK API and all platform classes that use OnBackPressed, which are planned for deprecation and which will require migration in the next major Android release following 13. For details, see documentation. This looks to me like a feature request to use the OnBackInvokedCallback platform API. That said, I'll go ahead and mark this as a feature request. While we are unable to promise any timeline for this, we'll definitely keep this under our radar. P.S. For folks who find this useful, adding an emoji thumbs up on the original post can help us prioritize adding this to the roadmap. |
I got around it by setting To begin with, can OnBackInvokedCallback be used when added with WindowManager#addView? |
There were no issues with Android 15 and Baklava, so this may also be a bug in Android 14 only. |
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:
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.
firebase-android-sdk/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/layout/util/BackButtonHandler.java
Line 23 in 377edcc
The text was updated successfully, but these errors were encountered: