Closed nikclayton closed 3 months ago
For ease of use, getAckDistributor sends an UNREGISTERED
intent when the distributor has been uninstalled: https://codeberg.org/UnifiedPush/android-connector/commit/2a7095029c6695e1b51ca3f29a346287f907dab8
Also, the example didn't check if the distributor was still installed before returning the endpoint: https://codeberg.org/UnifiedPush/android-example/commit/36a3d8d1eb5e6e6477b89649a160fc285089c4b1
I think this closes this issue
The library can get out of sync if the push distributor is uninstalled.
This can be reproduced with the sample app. To do so, on a test device or emulator:
mainFlavorDebug
variant of the sample app (so it doesn't include the FCM distributor)Bug 1: You'll see that
MainActivity
redirects toCheckActivity
, andCheckActivity
shows the old endpoint. While the endpoint may still exist (I don't know what ntfy does with registered endpoints when the app is uninstalled), no notifications from that endpoint are being delivered to the application.Bug 2: Although ntfy has been re-installed, the old endpoint is still shown.
Bug 2 can be fixed in the sample app by re-writing
onResume
from:to:
I'm not sure about bug 1. The cleanest thing I can think of is if
registerAppWithDialog
either:ACTION_REGISTRATION_FAILED
if no distributors are availableThis would allow the end-user app to easily detect this case and respond to it.