Native Rails clients with offline capabilities?

I realize this is a broad question, but I am quite lost on how to go about adding offline functionality to a Rails web app with iOS and Android clients. The native clients mostly use web views but might evolve progressively to native views calling JSON endpoints. In priority the offline question applies to those clients with their web views and native views, and secondarily it applies to the web app itself.

Is there any documentation/guide about adding offline features to Rails and its native mobile clients? Is this something that can be considered?

I guess one might say that this has nothing to do with Rails itself, but I’m sure other Rails apps are facing the same question, so any kind of pointers would be very appreciated.

This is certainly a challenge common to a lot of web frameworks, but i don’t think it’s fair to mark it as a Rails WTF.

Offline depends very much on your app functionality. For a native app with native views, you might cache some data from the last online access and use that

For a web app, you might want to look into Progressive Web Apps (PWAs) and LocalStorage for the caching. The serviceworker-rails gem might be of some help there.

1 Like

Good point, I have changed the post’s category, and thank you for the serviceworker-rails pointer.