Screencast Request: iOS / Android Adapter Example
Hey Chris -- Thanks for all the great content. I've been enjoying it for quite awhile; you do a great job, really. I'd love to see a short tutorial on how to take a rails app or a portion of a rails app and convert it into an iOS (or Android) app using the Turbolinks 5-based adapter(s). (As an example of a 'partial' app, maybe a site like Gorails would roll out an initial iOS app that only featured the screencasts, or only the community section; just a portion of the overall site.)
This is something I might try to do in the next couple of weeks and there aren't many good resources out there that I could find. I've watched your Turbolinks 5 videos, which are helpful but don't quite dive into actually building the iOS/Android app. (If you or anyone knows of any good resources, please let me know.) Thanks again for all your great work!
I've not heard of the Turbolinks 5-based adapter but I'm going to look into it and if you think it works then it is something that would seriously interest me as well.
I've been hoping for a while that someone like One Month (as this probably would be out of the scope for Gorails) would make a series covering creating an API for your rails app that links up to a iOS app that you also create.
Yea I think the adapters could be a real game-changer, especially for early-stage and small companies that can't afford to devote the resources to developing separate web and mobile apps (which happens to be where I'm at). I've done a lot of research and experimented with different options (e.g., React, Swift, React Native), but the Turbolinks 5 adapters seem the most promising for minimizing additional workload. This article by DHH has a good discussion of how they could be used: https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-navigation-web-content
I'm way behind, but I did an episode on this briefly to explore what you'll need to do: https://gorails.com/episodes/turbolinks-5-forms?autoplay=1
I'm going to be building some more like this, and also APIs for your mobile app if you need it to be native as well. It's helpful to dive into the iOS code and everything to understand how your Rails API will be consumed, so I'm sure we'll be doing some of that as well.
The Turbolinks 5 adapters are super slick and really make it a lot easier to manage though if you don't need too much native stuff.
Hey Mark - Unfortunately I didn't find any great resources. The video I posted above was helpful -- if you watch it, you'll see how quick and easy it is to roll out a basic ios app. From there, for me, it was just a matter of trial and error and piecing together various resources (none of which, in isolation, was that helpful). Overall, I'd highly recommend trying this approach. It really is very efficient, especially if you're ok with have little-to-no native features at first (which, imo, is ok especially for a prototype or early stage).
A couple quick tips that come to mind:
- One of the things I spent a lot of time on was getting my ios app to have the correct navigation feel -- i.e., when you click a button, which way does the screen move, and what text displays on the iOS navbar (e.g., "back")? This was more iOS than rails. One way to cut through all of this, which I eventually discovered, was just hiding the iOS navbar and rolling with your standard rails web navbar. If you don't have a good amount of iOS experience, I'd recommend this approach for a quick prototype.
- Take a look at rails variants. They're pretty cool and make it easy to make just a single view file (including a partial) differ on your iOS app versus your web app.
Let me know if you need anything else, and good luck!
Thanks for taking the time to reply. Your tips are a massive help.
I'm slowly getting my head around the basic setup and code in xcode.
Do you have any experience in adding offline support to your Turbolinks hybrid app? If yes, are you able to give some basic information on your implementation?
Thanks again.
By "offline support", do you mean the ability for your app to work even when the user is not connected to the Internet? (As opposed to, for example, customer support.) I'm assuming that's what you mean, and if so, I don't have any experience. It's something I've thought about very briefly but never pursued much.
When I've thought about it, I've always thought I'd start here: http://railscasts.com/episodes/247-offline-apps-part-1
And then progress. This also seems useful, though not exactly on-point: https://medium.com/@addyosmani/progressive-web-apps-with-react-js-part-3-offline-support-and-network-resilience-c84db889162c#.j00uc48e9
If you make progress on this issue let me know. I'd be interested in maybe trying to add this functionality depending on how it goes for you.
I'm basically trying to adopt the "offline first" approach for my mobile app and have decided that it's currently not possible with Turbolinks 5. If you're interested, I had a brief discussion with Chris about it in the comments here