Rails as a Backend for an IOS Application

1,759 views

Published on

Lightning talk given to Vancouver Ruby Meetup group on Mar 28, 2013

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,759
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
7
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Rails as a Backend for an IOS Application

  1. 1. Rails as a Backend for an iOS Application Ian MacKinnon Vancouver Ruby Meetup Lightning Talks Mar. 28, 2013Thursday, 28 March, 13
  2. 2. We’ll be Talking About • Authentication • REST access • NotificationsThursday, 28 March, 13
  3. 3. Authentication • https://github.com/applicake/doorkeeper • has slightly outdated Railscast • now supports Mongoid • OAuth development environment can be a pain b/c of port number w/ simulator (RestKit ignores it) • Most iOs libraries will keep a regular sessionThursday, 28 March, 13
  4. 4. RESTKit • Your go-to for remote object loading and persisting (can even integrate with coredata!) • Handles JSON/XML to object mapping • Gotchas: • Rails expects nested attributes for params • Need root JSON element for mapping • JSON payload size mattersThursday, 28 March, 13
  5. 5. Configure RestKit to POST with a root pathThursday, 28 March, 13
  6. 6. Thursday, 28 March, 13
  7. 7. Ease up on JSON Size • Normal for application to be run on 3G • Override a model’s as_json to determine the model attributes that will be sent across wireThursday, 28 March, 13
  8. 8. APNS (push notifications) • Used to suck but there’s a pretty awesome gem now • Grocer (https://github.com/grocer/grocer) • “There are other gems out there to do this, but grocer plans to be the cleanest, most extensible, and friendliest.” • Different Gateways for Dev and Production • Token identifies a device, not a userThursday, 28 March, 13
  9. 9. GrocerThursday, 28 March, 13
  10. 10. MISC • SSL Certificates are worth it • Parse is an alternative way of getting up and running quick • But you might need a web presence too • Kind of hard to migrate when you have a bunch of apps pointing to api.parse.comThursday, 28 March, 13

×