textileio / go-textile

[DEPRECATED] Textile is a set of tools and infrastructure for building composable apps and services on the IPFS network
https://textile.io
MIT License
357 stars 43 forks source link

Push Notifications #589

Open sanderpick opened 5 years ago

sanderpick commented 5 years ago

Most real world use cases are gonna require real time notifications. This is just something developers expect to be able to do. There are a bunch of avenues here:

  1. A single app approach is something we've talked about before. Others have too: https://github.com/ipfs/notes/issues/370
  2. A Cafe based approach which requires each dev to dedicate a machine of their own to notifications

Other considerations, by most important:

  1. Users should still be able to dictate where their data is stored and also opt-in to push notifications.
  2. Ideally, every app won't need it's own cafe for notifications. However, typically a server handling iOS and Android notifications only deals with one application. This may be more true w/ iOS, but in any case, switching applications is resource intensive.
  3. Ideally, the push mechanism should simply send a silent notification which wakes up the target app, does any needed data queries, and then finally delivers the content as a local notification.

Given 3., I don't think avenue num. 2 above would work because one app is not able to foreground another app w/o some user action.

  1. and 2. are somewhat contradictory. Here's a proposed solution that's a bit of a compromise between those two considerations:

Libraries:

sanderpick commented 5 years ago

An alternative to 3.: Encrypt the notification textual content with the account key.This would mean we could in fact go the single-app route, which would be amazing. You'd have to be able to decrypt the message in the app delegate (not familiar with android here). Sound possible @asutula?