My offline mobile app is not synchronising automatically

0
I have created an offline mobile app using the 'Hybrid Phone Offline' navigation profile. Upon first opening the app on my Android phone the database is synced and data is retrieved. However, when I close the app and start it up again it won't retrieve new the data (which I have added through an page in my 'Responsive' navigation profile). I added a manual sync button which works perfectly and retrieves new data. Any idea what might cause this? From the documentation I would expect it to sync upon (re)opening: "Lastly, the app will always attempt to synchronize if it is (re)started. If your device is not connected to the internet on startup, this step will be skipped." https://docs.mendix.com/refguide/offline       
asked
5 answers
2

I have filed a ticket for this and received a response from Mendix that this feature has been disabled. The documentation has now been updated:

"As of Mendix 7.6, the startup performance of offline apps skips data and file synchronizations on subsequent application startups. Mendix still does them, but only if your app has been redeployed in the meantime. In that case, synchronization consists of two steps: Uploading new and changed objects, and then recreating the database by downloading all necessary objects from the runtime."

One way to synchronize automatically is to add a javascript snippet on your page that clicks a hidden sync button.

answered
1

You can add a javascript snippet with syncronization code, which syncronizes on page load.

See the pull to refresh widget for syncronizing.
https://appstore.home.mendix.com/link/app/47782/

Using button onclick or touch events did not work for me on iOS devices, only on Android. So I would avoid using a javascript snippet to click on a hidden sync button.

answered
0

Hi Kelvin, did you check for any messages in the console when you debug your hybrid app using chrome developer tools?

Second try closing your app using device maintenance (tap optimise now), instead of closing it from the recent apps list. 

answered
0

Maybe too simple but..To me it seems that the app doesn't really restart unless I do a logout/login. Still strugling with offline here too.  

answered
-3

Issues regarding compatibility and choosing right platform ,technology for your app can be resolved with the expertise knowledge.You will get the best solution here.Click here.Hope this will helpout

answered