e-mission-phone icon indicating copy to clipboard operation
e-mission-phone copied to clipboard

Call ForceSync on app resume

Open shankari opened this issue 2 years ago • 3 comments

This is a UI-only hack to experiment with syncing on every app start/resume. In general, our assumption was that people will open the app only sporadically, and we want to push data more frequently than that. So we do so in a background process.

However, due to the various restrictions on background operations in android, sometimes the background process is not launched. We can ask the user to "force sync" but that is not a viable solution as well.

We push a UI-only update that force-syncs on every app launch to see the extent of this problem and confirm that this fixes it.

Once we know that this works, we should move this to native code, potentially by pushing data at the end of a trip as we do on iOS. We may also want to introduce silent push notifications on android as well.

Testing done:

  • Started app
  • Paused and resumed app

Saw message "app has started/resumed, forcing sync on android" in the console in both cases.

shankari avatar Sep 23 '21 07:09 shankari