OneSignal/OneSignal-Flutter-SDK

[Bug]: No push notifications after reboot until I unlock the phone 1 time

uj opened this issue · 1 comments

uj commented

What happened?

Push notifications work after I install the app. They work if I force close the app.

However, if I reboot the phone, they do not work UNTIL after I unlock the phone 1 time. Then, they work fine. After that, I can lock the phone again and they still work. I can force close the app, lock the phone, and they still work.

However, if I reboot again, they do not work until I again unlock the phone 1 time after the reboot.

Every time I reboot, they stop working until after the first unlock and then everything is good from that point forward (until the next reboot).

This is Android 14, Google Pixel 7

I am pretty sure the problem is the lack of "DirectBootMode" / "android:directBootAware" https://developer.android.com/privacy-and-security/direct-boot

When a phone has encryption, which most newer phones do, the apps cannot run until the phone is unlocked 1 time and the encryption is unlocked in that process. However, there is a android:directBootAware option in Android that allows an app to somehow work around that, as described in the above website link. I searched the github code for "directBootAware" and didn't see any results, so I assume this is not implemented.

I use Textra for SMS and I also noticed that I don't received Textra SMS notifications before the 1st unlock. However, I do receive an Android system notification with a default system sound (not the Textra notification sound) if I receive an SMS that says "You received an SMS. Open your SMS app to view".

Steps to reproduce?

Use Android 14
Create Flutter app with OneSignal Flutter SDK 3.5.2
Test that push notifications work.
Reboot phone, do not unlock.
Notice that push notifications do not work.
Unlock phone.
Push notifications work.

What did you expect to happen?

I expect push notifications to work after a reboot even if the phone has not yet been unlocked for the 1st time.

OneSignal Flutter SDK version

3.5.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

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