givelotus / lotus-vase

A simple reference wallet for Lotus which supports mobile devices.
GNU General Public License v3.0
4 stars 2 forks source link

Receive notifications #58

Open schancel opened 4 years ago

schancel commented 4 years ago

We need to notify the user when they've received a transaction and for how much. A OS notification would be good.

chinitadelrey commented 3 years ago

Possible solutions in order of complexity, ascending.

I think it is possible to get away with something like 1 on the home send screen given that the connection is on websockets (will not persist in background or in other apps afaik) and hence, we have notifications only when the user has his attention on the app open?

The most important part is fixing up the electrum api.

  1. Superficial 'notification' overlay widget https://pub.dev/packages/overlay_support#-readme-tab- https://medium.com/dev-genius/instagram-like-in-app-notification-flutter-eb2ce6a10d88
  2. Local notifications - can call native OS notifications. https://brainsandbeards.com/blog/how-to-add-local-notifications-to-flutter-app https://itnext.io/local-notifications-in-flutter-6136235e1b51 https://www.geeksforgeeks.org/background-local-notifications-in-flutter/ https://github.com/JohannesMilke/local_push_notifications/blob/master/lib/local_notications_helper.dart
  3. We want to not have to use Apple or Android push notifications to reduce complexity and also for user privacy (?). The connection is on websocket and will not persist in background.
schancel commented 3 years ago

Yes, 1 works easily with some refactor. I looked into the other two briefly. 2 seems preferrable as you don't need any changes to the electrum API. Anything else would require us putting some kind of intermediate layer up that we have to run ourselves. Maybe in time we'll want to developer our own indexer, because electrum kinda sucks.