defold / extension-push

This is a Defold native extension which provides access to Push Notifications functionality on iOs and Android devices.
https://www.defold.com/extension-push/
MIT License
20 stars 16 forks source link

Fix/local push anr #39

Closed AGulev closed 2 years ago

AGulev commented 2 years ago

Fix https://github.com/defold/extension-push/issues/37

There are two ideas behind this fix:

  1. WakefulBroadcastReceiver is deprecated (also it used in a strange way without creation of a service), we need to replace it with a regular BroadcastReciever
  2. LocalNotificationReceiver -> onReceive() should be as light as possible, that's why I moved creation of the Notification into scheduleNotification() method
AGulev commented 2 years ago

@britzl I tested this PR on 2 devices: Android 6.0 Android 11 It would be nice if you can test on something else, thx!

I tested 6 different options: local notification: app is open local notification: app is in background local notification: app is closed remote(push) notification: app is open remote(push) notification: app is in background remote(push) notification: app is closed

britzl commented 2 years ago

Local notifications work on a Xiaomi with Android 11. Going to charge another device and try that as well.

britzl commented 2 years ago

Going to charge another device and try that as well.

Works well on a Razr with Android 8.1.0!