AppLovin / AppLovin-MAX-Unity-Plugin

127 stars 35 forks source link

AdMob adapter breaks the Local notification rescheduling after reboot. #420

Closed SlavomirDurej closed 2 months ago

SlavomirDurej commented 2 months ago

MAX Plugin Version

6.6.3

Unity Version

2021.3.40

Device/Platform Info

Android

Current Behavior

If I select Google AdMob Mediated Network adapter (atm V23.30.0 Android version) after rebooting device my Notifications are no longer rescheduled. If I DO not select this particular adapter, (but I still have Unity Ads or Facebook Ads selected) they are rescheduled and everything works as expected. I have tested this both with Unity Notifications plugin and Voxel Busters Essential Kit Native extensions, and it's the same result.

I can see the Manifest DOES include required permission (RECEIVE_BOOT_COMPLETED) and appropriate receivers, etc, so this is not an issue and more importantly it DOES work just fine with other mentioned network adapters, unless I include AdMob.

Expected Behavior

Notifications are being rescheduled after device reboots / restarts / shut down.

How to Reproduce

Create empty Android app add Unity's notification package and Max plugin. Make a simple button that triggers Local notification that is scheduled to show in 5 minutes. Make sure you check "Reschedule after restart in Notification settings". Install AdMob mediated network. Press the button, to schedule a notification then restart the app. Scheduled notification should appear within 5 - 10 minutes or so, but it won't show up. Uninstall AdMob and do the above steps, and it will work as expected.

Additional Info

No response

SlavomirDurej commented 2 months ago

The problem was in the AdMob removing RECEIVE_BOOT_COMPLETED permission from the Manifest. The solution is to add it with the tools:node="replace" attribute in Custom manifest.