简体   繁体   中英

How to develop native ios app with existing Rails app as backend?

I'm working on a service which can let users create simple profiles.

It was made by reference to Ruby on Rails Tutorial( https://www.railstutorial.org/ ).

It can authenticate users simply with email and password.(without devise)

Question:

  1. How to authorize users from ios in my Rails app?
  2. How to post article to my Rails app from ios app?

Environment:

  • Rails 4.2
  • Swift 2.0

I would like to know the details of authentication flow and sample code.

  1. Your users can auth by sending their email and password using a HTTP secure post request. The response would be a token that they can use for all future requests.

  2. Your iOS app can make a secure HTTP POST to a resource like /api/posts . The API Posts controller would create a new Post from the params.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM