Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android onesignal push notifications do not appear after device reboot

Problem
In my webview app, I use onesignal to send user push notifications from my server. The device receives notifications not only when the app is running but also when it is completely closed. However, if I switch off and then switch on my phone, I do not get the notifications. And only after launching the app, I obtain those messages.

Idea
My idea was to launch my app on boot and immediately close it, so the user does not even notice it. However, I do not think it is a very good solution.

How do the developers usually solve this issue?

like image 896
ElonMuskofBadIdeas Avatar asked Nov 16 '25 04:11

ElonMuskofBadIdeas


1 Answers

first of all you must wait at least 24 hr after reboot to make sure that the notifications are delivered or not (per documentation)

sample

To make this waiting period shorter you should set the notification Priority to high priority 10

High Priority: These notifications are delivered immediately, though fall subject to the standby bucket policy on the device.

Set a high priority 10 if you need it to go through any doze mode / other power saving modes. But only use priority 10 when you really need to as there is a daily limit where it might fallback to normal priority.

like image 87
Jabbar Avatar answered Nov 18 '25 17:11

Jabbar