Updating json files once installed on device


#1

I am creating an Ionic app and there are few json files in the www/dataFiles folder. I need to package these files with the app. However, once installed on the device these json files need to be updated periodically with new data from a server. I was searching for days trying to figure out how to do it and I found out that files in the www folder cannot be rewritten. I have no clue how to move forward. Do I have to save files in a different location? I would really appreciate if you can point me in the right direction.

Thank you in advance.


#2

You can update your app and content using IONIC deploy. This would allow you to update the files in www/dataFiles as well. Another option is to use the ContentSync plugin and store your JSON files in the device’s filesystem. There’s a nice article about how to use this plugin on Raymond Camden’s website here.