Coder Social home page Coder Social logo

lyft's Introduction

Lyft SDK

[![CI Status](http://img.shields.io/travis/Genady Okrain/Lyft.svg?style=flat)](https://travis-ci.org/Genady Okrain/Lyft) Version License Platform

Requirements

Please signup and read: https://developer.lyft.com

Installation

Lyft is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Lyft"

Usage

API Keys

Lyft.set(clientId: "clientId", clientSecret: "clientSecret")

For testing please use sandbox mode:

Lyft.set(clientId: "clientId", clientSecret: "clientSecret", sandbox: true)

Deeplinking

Lyft.openLyftRide(rideType: .Line, destination: Address(lat: 37.7763592, lng: -122.4242038))

Don't forget to update Info.plist to support lyft://

Authentication

Client Credentials (2-legged) flow for public endpoints

Lyft.publicLogin { success, error in

}

3-Legged flow for accessing user-specific endpoints

Lyft.userLogin(scope: "public") { success, error in

}

You will need to setup a redirect too:

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
  return Lyft.openURL(url)
}

Availability

Lyft.requestRideTypes(rideTypesQuery: RideTypesQuery(lat: 37.7833, lng: -122.4167)) { result, response, error in

}

Lyft.requestETA(etaQuery: ETAQuery(lat: 37.7833, lng: -122.4167)) { result, response, error in

}

Lyft.requestCost(costQuery: CostQuery(startLat: 37.7833, startLng: -122.4167, endLat: 37.7972, endLng: -122.4533)) { result, response, error in

}

Lyft.requestNearbyDrivers(nearbyDriversQuery: NearbyDriversQuery(lat: 37.7789, lng: -122.45690)) { result, response, error in

}

Rides

Lyft.requestRide(requestRideQuery: RequestRideQuery(originLat: 34.305658, originLng: -118.8893667, originAddress: "123 Main St, Anytown, CA", destinationLat: 36.9442175, destinationLng: -123.8679133, destinationAddress: "123 Main St, Anytown, CA", rideType: .Lyft)) { result, response, error in

}

Lyft.requestRideDetails(rideId: "123456789") { result, response, error in

}

Lyft.cancelRide(rideId: "123456789") { result, response, error in

}

Lyft.rateAndTipRide(rideId: "123456789", rateAndTipQuery: RateAndTipQuery(rating: 5, tipAmount: 100, tipCurrency: "USA", feedback: "great ride!")  { result, response, error in

}

Lyft.requestRideReceipt(rideId: "123456789") { result, response, error in

}

Lyft.requestRidesHistory(ridesHistoryQuery: RidesHistoryQuery(startTime: "2015-12-01T21:04:22Z", endTime: "2015-12-04T21:04:22Z", limit: "10")) { result, response, error in

}

Author

Genady Okrain, [email protected], @genadyo

License

Lyft is available under the MIT license. See the LICENSE file for more info.

lyft's People

Contributors

genadyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.