robosats icon indicating copy to clipboard operation
robosats copied to clipboard

Android notification system

Open KoalaSat opened this issue 1 year ago • 0 comments

What does this PR do?

Screenshot from 2024-07-12 21-48-50

This PR includes all the necessary code to have torified notifications. A background job runs every 5 minutes, even if the app is off, to check if the user has new notifications on their active orders. Important points to consider:

  • There is a warning notification that runs every time the app starts, I couldn't find a way to show it only once, since it appears to be a warning forced by android.
  • The 5 minutes gap is set to avoid DDoSing our own coordinators, the idea is still to allow people to run coordinators with minimum reliable machines from home.
  • For the same reason, the android app has to see at least once the order of the robot, that way we make sure it's worth to query. Doing this for every robot in the garage for all coordinators every 5 minuter will be also dead by DDoS.
  • If the user taps on the notification, the app opens with the order view even if it was off. I had to do some black magic here because of WebView so it's worth testing.

This code also takes into consideration https://github.com/RoboSats/robosats/pull/1356, being compatible with latest release's code and these changes.

Checklist before merging

  • [x] Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

KoalaSat avatar Jul 12 '24 19:07 KoalaSat