OneSignal/OneSignal-Android-SDK

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

Opened this issue · 0 comments

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