I’m currently facing a rather unique issue with a client request.
We’ve built a small wordpress website for our client to log parking violations in various car parks. So far we’re using Gravity Forms to have the employees submit entries and edit them afterwards.
No the client wants the whole thing to work while offline, since there’s not always good connection in the car parks.
That’s where the problems start. I was able to setup a pwa on wordpress and check the online status. If we’re offline, I’m saving the entry data to local storage and as soon as we’re back online we’re sending the data via gravity forms rest api.
The gravity forms api however can’t process images, which we desperately need. So my solution is switching to ACF with front end submission pro plugin to easily create the form and be able to edit entries.
Since ACF is so complex however, I’m kind of stuck on the workflow of checking the connection status and if offline, save the data to local storage and send it once back online.
The idea is: hook into acf/save_post and check connection status using the running pwa plugin. If offline, save $_POST contents to local storage and stop form submission by returning null. Once back online, read load $_POST from local storage and run acf/save_post again.
So I guess my question is: Has anyone here realized something similar or has any insight/tipps on how to implement this for multiple form submissions while being offline and submitting all data once the connection is reestablished?