OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

[Bug]: In-App Popup Not Displaying After Being Closed with Back Press

Open KirillBorodin opened this issue 1 year ago • 2 comments

What happened?

It seems that issue https://github.com/OneSignal/OneSignal-Android-SDK/issues/1826 is still reproducible in Release 5.1.26

From the source code investigation, it appears that the OneSignal Android SDK is attached to the consumer’s app activity where the plugin is used. Consequently, managing the activity’s onBackPressed behavior falls outside the plugin’s scope. Furthermore, when the plugin is initialized in a Flutter app, onBackPressed cannot be properly handled to dismiss the In-App Message due to the specific communication mechanisms between Android and Flutter (method channels).

See issue example:

https://github.com/user-attachments/assets/00e0e804-5fa5-4fa8-a4fb-1c8db0b80b29

Steps to reproduce?

1. Tap on the In-App Message to trigger it.
2. Wait for the popup to be displayed.
3. Close the popup by pressing the Android back button.
4. Attempt to trigger the In-App Message again by tapping on it.

What did you expect to happen?

The In-App Message should open every time it is clicked.

OneSignal Android SDK version

Release 5.1.26

Android version

12

Specific Android models


Relevant log output


Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

KirillBorodin avatar Jan 27 '25 10:01 KirillBorodin

Hi @KirillBorodin, thanks for reporting.

My apologies, you are correct and this behavior is still happening. The previous issue was incorrectly closed.

nan-li avatar Jan 30 '25 18:01 nan-li

Hi, I'm experiencing the same issue on my side. Has anyone found a workaround or a fix for this? Any help would be greatly appreciated! @nan-li @KirillBorodin

mtaran89 avatar Apr 11 '25 14:04 mtaran89

Hi @KirillBorodin and @mtaran89

We have fixed the unexpected behavior with in-app messages and the use of the back button in Release 5.1.35. The in-app message should now be correctly dismissed and available to be triggered again.

Please upgrade and let us know if you still run into any unexpected behavior.

nan-li avatar Jun 30 '25 22:06 nan-li

Hi @nan-li ,

Thank you for the fix and for letting us know.

We've just tested the behavior on Release 5.1.35, and I can confirm that the in-app message is now dismissed properly when using the back button and can be triggered again as expected.

Appreciate your support — everything looks good on our end now.

mtaran89 avatar Jul 03 '25 11:07 mtaran89