Question on local scheduled notify notifications not sending after android reboot. #28
-
|
Hi Marco, I have used notify to make the notifications, however I seem to come into some problems and issues. All the functions works, except when we reboot the android device. After that the scheduled notifications does not fire at scheduled time. So I would like to know, if notify-kit actually support the scheduled android local notifications being able to send properly after the restart of device. Or is this just the limit of react native app, and would require some push notifications to send notifications reliably after restart, without app being open? If it does support, is there any specific formats or pipelines required for this to work? Would really appreciate your help, i am stuck on the notifications for half a month now. was using expo notifications before, but research shows its actually not reliable, so i turned to notify. P.s Also downloaded your amazing app GymBroTools, and gave a 5 star review :) Further info: Trigger type: TriggerType.TIMESTAMP (oneshot and reschedule) (Affect what RebootBroadcastReceiver has to restore) Step 1 — Device reboots
Channel setup: Have 50 total trigger and notification limit Plugin fixed (confirmed with androidmanifest in decompiled app): |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @theaitechnician, thanks for the detailed report, and thank you also for the GymBroTools review. I really appreciate it. Yes, A future one-shot I also validated this path on my side with both:
In both cases, the trigger was scheduled before reboot, the device was rebooted, and the Android alarm was re-armed after reboot. So I would not treat The next thing I would check is the final Android integration in your app. A few important points:
Could you share a bit more package-specific information?
That should tell us whether |
Beta Was this translation helpful? Give feedback.
-
|
@marcocrupi Thanks for the detailed answer, we have made some progress. Here's what i find: Xiaomi12(android: 13 TKQ1.220807.001)(MIUI: 14.0.3) (API Level via ADB: 33) What the Plugin did: so without the plugin those would be false and i believe it makes the app unable to listen to the boot signals. at least that's what the ai say, but i do see some evidence saying even false works. confirmed from the permissions section from decompiled manifest. : Logcat of the ai analysis is uploaded. But I think the ai analysis of that is just fine, u can read that first, and see if that covers what u want to look for. 2 key findings: Finding 1 — Root Cause Confirmed: MIUI Autostart SuppressionWith autostart OFF, the log shows MIUI's
With autostart enabled, notifications fire on schedule successfully. This is the confirmed fix. Finding 2 — BOOT_COMPLETED Reaches TaskBroadcastReceiver, Not RebootBroadcastReceiverWith autostart ON,
Whether opening the app once after reboot causes the triggers to be recovered: After that i did more investigating, and on the xiaomi12, i have finally be able to trigger the notification after the restart of device, the key was : On MIUI 14, there is a new permission to start from the background for each app, in Settings > Apps > Your app > App permissions > Background autostart. If i set that then the scheduled notifications fire. Then i look at other apps as well, some never have to do this on autostart, yet they are still able to send local notifications, so i am still investigating. if there are better ways to do it, it seems a lot of android manufacturers, suppress the boot signal, and the app will never receive it, and what is worst is, every manufactor have some different settings to this. So i am trying to find an alternative way to make this work, but i am currently adding the instructions to the phone for these. For future lookers: dontkillmyapp.com is a good source to look for a solution or some guides for it, but it seems not all are accurate, so do your due diligence with manufactory and it would change with time. So Marco, what do u think? How best to approach this? i think we need to make some documentations on this for future users as well, if the only solution is to guide them to allow auto start. |
Beta Was this translation helpful? Give feedback.
Thanks for the follow-up. This is very useful.
Your MIUI finding makes sense. If MIUI logs:
process is not permitted to auto startthen the app process is blocked before Android can deliver
BOOT_COMPLETEDto any receiver inside your app package. In that situation NotifyKit cannot re-arm the alarms at boot time, because the app is not allowed to start.So yes, on Xiaomi/MIUI, enabling Autostart / background startup is the practical mitigation for this class of issue. The fact that notifications start working after enabling Autostart is a strong confirmation that the main problem is the OEM background-start policy, not
TriggerType.TIMESTAMP.About
TaskBroadcastReceiver: that receiver belong…