Native Mobile App synchronize data to external systems

0
Hi, As per my requirement I need to synchronize the data created in offline mode with external systems when the device becomes online. As off now I can think of below solutions Have a button to manually synchronize: Challenge here would be to create a delta to synchronize every time synchronization is triggered. On Post Commit Event Handler: Not sure whether this works. I feel its going to be costly operation because this will trigger for each object and I don’t think its a good idea to make an external service call for each object   Any better ideas to implement this functionality? Also looking for a solution for automatic external synchronization instead of manual.   Regards, Mohan
asked
2 answers
1

Hello Mohan,

With the widget App Events from module Native Mobile Resources you can trigger when device network status is changed to online: a nanoflow with custom logic or trigger default ‘synchronize all’.

Any new or changed objects can be filtered with a isSynced($object) check. (https://docs.mendix.com/refguide/special-checks#synced)

EventHandlers are only called on the server and not on the device, so will only be triggered when device syncronizes with the Mx server.

answered
0

Hi Mohan,

For the 1st point what i can suggest is, in the landing page of Mobile offline application, create one data source microflow and do the following activities :

1. Create JS to check device network mode (Online or Offline) and it should return a boolean value
2. If device is in offline don’t map any synch logics, else call 2nd point Synchronization logics.

The advantage of this is, no need to manual synch always when device is in online mode, automatically synch will happen in the background.

And i am not sure about 2nd point.

answered