I've just spent a lot of time looking into the best ways to create iphone and android apps for an existing rails app that I've built and I feel that I haven't actually gotten any closer to knowing how to best achieve this.
What I want:
- I would like to have the rails app and the mobile code cleanly separated. I'm not looking to just render a different layout in my rails app. I'd prefer to use something like phone gap that allows me to use roughly the same codebase to run the mobile apps.
- I'd like to have offline/sync capabilities in the mobile apps (hence if a user creates a record on their iphone while they are out of coverage the app should save the record on the phone and continue to try to to sync that record to the web app until success.
- Having access to the hardware features will be needed down the road. GPS, accelerometer, etc.
My questions:
- Is this a good situation to use oauth? Would I just build an oauth provider into my web app and then build the two mobile apps as clients to the web app?
- Is there an easier method for secure authorization that I'm missing?
- Does Devise work with oauth? My app is built on top of devise at the moment.
- Is this syncing something that should be abstracted to a middleware or metal?
Sorry, I know this is actually a lot of questions but I'd like someone who is familiar with the situation to answer in a comprehensive manner rather than just a couple little pokes that leave more questions. I feel like this has to be a common situation now-a-days but I can't seem to find anything up-to-date in my searches.
Cheers!
ps. - If you've done something like this yourself and know how to pull it off, I'd love to talk to you directly. I'll even buy the beers.