Sync data between two devices

Hi Journey,

How can I force changes that were created from the desktop container/user to be available to the mobile container/user while on the same screen without waiting for +1min?

Both devices are connected to the internet

@sisa-zaza

You can force a sync with the following code:

journey.synchronize()

It’s referenced towards the end of this section: https://docs.journeyapps.com/reference/build/js-ts-apis/journey

Another thing that helps, depending on the exact workflow, is to send a PN to the device that you want to keep up to date. When receiving a PN the device will also perform a sync, and so there are some workflows / use cases where receiving the PN is the ideal trigger for updating the data on the view in question.

A typical example would be waiting for a report to generate. Once the report is generated the CC task sends a PN to the user that is “waiting” for the report and then upon receiving the PN the data is also updated.

Obviously this would not work for constantly streaming changes between devices as it would create a lot of PN spam.

3 Likes