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

[Bug]: Opening a OneSIgnal notification from an Activity that supports Picture In Picture causes a broken experience #2181

Open
1 task done
alexsullivan-substack opened this issue Aug 20, 2024 · 0 comments

Comments

@alexsullivan-substack
Copy link

What happened?

Using version 4.8.2 of the OneSignal SDK we're running into an issue where tapping a OneSignal notification causes our (singleTask, single activity) app to enter picture in picture mode and then enter a bugged out, non responsive state. I suspect this is partially an Android OS bug. You can see the behavior in the attached video.

pipbug.mp4

After extensive debugging, this seems to be happening because the com.onesignal.NotificationOpenedReceiver activity has a taskAffinity set to "", which the Android OS appears to consider a reason to trigger the onUserLeaveHint callback after a notification is tapped (I guess because the user is leaving the current task affinity and migrating to a different one). onUserLeaveHint is where you transition your activity into picture and picture mode. I suspect the fact that OneSignal quickly finishes that activity and launches our main activity causes the followup broken behavior.

You should be able to reproduce the broken behavior if you create a project with one singleTask activity that supports picture in picture mode. Tapping a OneSignal notification in that project should recreate the broken behavior.

Steps to reproduce?

1. Install version 4.8.2 of the OneSignal SDK (likely also exists for more recent versions)
2. Create a project with one singleTask launch mode activity that supports picture in picture via the `onUserLeaveHint` method.
3. Trigger a OneSignal notification and tap it.

What did you expect to happen?

I expected the app to not trigger picture in picture mode.

OneSignal Android SDK version

Release 4.8.2

Android version

15

Specific Android models

* Android Studio Pixel 7 API 35 emulator (and other pixel devices in the wild, not reproducible on Samsung devices we've tested on though)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant