Android won't let the local Relaynet gateway run unless the user is interacting with it or a Relaynet-compatible app, so the plan is to get the public gateway to ping the Android gateway via a Firebase push notification to get the Android gateway connect to the public gateway to retrieve the new parcel(s).
Describe the solution you'd like
The public gateway will only send a ping message if all the conditions below are true:
A new parcel bound for that Android gateway is received.
The Android gateway doesn't currently have a WebSocket connection with the public gateway.
The public gateway hasn't sent another ping message since the last WebSocket connection.
The gateway is likely to have to display a foreground notification whilst retrieving parcels in the background.
Needless to say that this will be specified in a vendor-neutral manner, so that any public gateway provider with a Firebase account can use this functionality.
Describe any alternatives you've considered
Keep the WebSocket connection open permanently at the expense of a permanent foreground notification, which requires explicit user consent, can be annoying/distracting and drains battery. Having said this, we may still have to implement this as a fallback when connected to public gateways that don't support Firebase push notifications.
Executive summary
Android won't let the local Relaynet gateway run unless the user is interacting with it or a Relaynet-compatible app, so the plan is to get the public gateway to ping the Android gateway via a Firebase push notification to get the Android gateway connect to the public gateway to retrieve the new parcel(s).
Describe the solution you'd like
The public gateway will only send a ping message if all the conditions below are true:
The gateway is likely to have to display a foreground notification whilst retrieving parcels in the background.
Needless to say that this will be specified in a vendor-neutral manner, so that any public gateway provider with a Firebase account can use this functionality.
Describe any alternatives you've considered
Keep the WebSocket connection open permanently at the expense of a permanent foreground notification, which requires explicit user consent, can be annoying/distracting and drains battery. Having said this, we may still have to implement this as a fallback when connected to public gateways that don't support Firebase push notifications.