This PR adds a number of improvements to the notifications workflow.
There is now a second line to the notifications setting subtitle that can help us to identify the current state of things.
When using local notifications, it says if we don't have OS permissions. (You could do something similar for APN/iOS.)
When using UnifiedPush, we will display whether we were able to find a compatible app or not with the following logic.
If no apps are found, a message to that effect is displayed.
If we find 1 app, but aren't connected yet, tell the user to restart.
If we found more than 1 app, tell the user we don't support that (we would have to present a selector dialog to them, which we can add later).
Otherwise, we tell the user what app we are connected to.
When the user denies OS notifications, the snackbar now presents an option to navigate to system settings for them to enable it directly (in case they made a mistake).
As part of the subtitle when selecting UnifiedPush, suggest and link to ntfy in F-Droid store.
Updated the error message for disabling notifications to indicate it's really a problem with the server.
I removed the instance name from the UnifiedPush registration. For some reason, with an instance name, I never got any callbacks (onNewEndpoint, onMessage) and getDistributor() always returned null. The registration is still unique to our app, so I hope we don't need the instance feature.
Everything here should be covered in the demos below.
Pull Request Description
This PR adds a number of improvements to the notifications workflow.
onNewEndpoint
,onMessage
) andgetDistributor()
always returnednull
. The registration is still unique to our app, so I hope we don't need the instance feature.Screenshots / Recordings
OS Permissions Denied
https://github.com/thunder-app/thunder/assets/7417301/62818c9f-04d5-4819-a79c-7703c026565d
OS Permissions Redirect
https://github.com/thunder-app/thunder/assets/7417301/7574ea28-c0be-4c87-b26a-74dadaa768c3
UnifiedPush Flow
https://github.com/thunder-app/thunder/assets/7417301/5b8b9601-b537-4eb2-a0b1-3189eb177b0d