Closed AmarOk1412 closed 6 years ago
Ok.
What I developped is basically the same system described https://matrix.org/docs/spec/push_gateway/unstable.html. The only difference is we also pass encrypted values in the notification and they just use the notification as a wake-up notification. (We also use it has a wake up notification to enable the daemon and decrypt the data on the phone).
Problem
On some platforms (like iOs), you can't really have a node running in background h24. We currently have the proxy, but we need to maintain the connection for
listening
operations.Solution
Have the possibility to supports push notifications on the proxy node.
Warning
This option must be disabled by default. It breaks the distribution... because the proxy should have the certif for the app.
How
Add
SUBSCRIBE
andUNSUBSCRIBE
toDhtProxyServer
. Subscribe will perform a Listen on the DHT and send values for the device (he must have a key) and return a token. Unsubscribe will do a cancelListen.Because a client can not call
unsubscribe
we must have a timeout to remove old listen operations.When the proxy server receives a value, it will send a push notification. To avoid tools like Firebase, we can host our own push notification server like https://github.com/appleboy/gorush. Sadly, it will use GCM or FCM for android and APN for iOs (if anyone know another viable solution)...
For Fdroid, this option must be disabled, and we will use listen like before (with or without DHT Proxy).
Things to determine