Black screen on opening notification
Description:
When I open a notification sent via Onesignal dashboard, the unity app(which was backgrounded) opens with a black screen and only game sounds keep playing. Tapping on the screen does not do anything.If you background the app in this state, the game sounds keep playing till you force quit the app.
Environment
Onesignal version 2.13.0
Project dependencies Prime31(Etcetera),Firebase(Dynamic Links,Messaging),Facebook SDK,Singular.
Platform issue occurs on Only Android
Steps to Reproduce Issue:
- Initialize one signal sdk
- Register a unique user id as external user id
- Background your game after initialization.
- Send a test message via onesignal dashboard
- When the device receives the message on the notification bar, tap on the notification
- OnMessageReceived callback is received via the FCM's plugin as well as onesignal
- Black screen shows on the screen with game sounds running
- Background game - Even on background game sounds keep playing
- Open another game while the game sounds play. Still game sounds play.
Anything else:
- Prime31 plugins extends UnityPlayerActivity. To allow activity sharing, I use this - https://gist.github.com/prime31/0908e6100d7e228f1add - to listen to some of the android events.
- Firebase messaging is used for some other push functionality in the game. Even though onesignal uses FCM internally, we needed Firebase messaging to fix some issues we were facing earlier.
- onResume() does get called when the notification launches the app but after that it is completely black and does not take any input.
@dcz11 Thanks for reporting, there are a lot of dependencies and events in play here. We have a OneSignal-Unity-SDK new major version 3.0.0 out now. It has a ton of internal changes (some around Android Activities as well with notification open event). To upgrade please check out the full migration guide for step-by-step on upgrading: https://github.com/OneSignal/OneSignal-Unity-SDK/blob/main/MIGRATION.md
If the 3.x.x version does not help could you attempt to create a new project to reproduce the issue? (if that is not possible could you try to remove some to narrow down the root cause?)
Closing this for now. Feel free to reopen this issue if you have any additional details