Latest 0.4.0
License MIT
Platforms ios 11.0
Dependencies HandyJSON

CI Status


To run the example project, clone the repo, and run pod install from the Example directory first.



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

pod 'TaxiGoDev'


You can access TaxiGoDev API like this:

var taxiGo = TaxiGo.shared


  • Set up Your URL Types
    Your Project -> TARGETS -> Info -> URL Types -> URL Schemes, Identifier ->

    taxiGo.auth.appID = <YOUR_APPID>
    taxiGo.auth.appSecret = <YOUR_APP_SECRET>
    taxiGo.auth.redirectURL = <YOUR_REDIRECTURL>
    taxiGo.api.url = <SAND_BOX_URL/PRODUCTION_URL>
    taxiGo.api.apiKey = <YOUR_API_KEY>


  • User Authorizes Your Application
    TaxiGo provides an authorization page where user can sign in with their LINE account and grant permission to your application. In the example, we use UIApplication to open the url.

    let url = URL(string: "<YOUR_APPID>&redirect_uri=<YOUR_REDIRECTURL>"), options: [:], completionHandler: nil)
  • Redirect
    If you successfully sign in with your LINE account, TaxiGo will return a redirect uri along with an authorization code. You can access the authorization code as following:

In AppDelegate.swift, add the following to your application(_:open:options:) method.

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
    taxiGo.auth.authCode = taxiGo.auth.getAuthCode(url: url)
  • Get User Access Token
    After you access the authorization code, you will be able to retrieve your access token and start using TaxiGo’s API.

    taxiGo.auth.getUserToken(success: { (auth) in
    // do something with the auth

}) { (err) in
// do somwthing with the err

#### Request a ride
taxiGo.api.requestARide(withAccessToken: String, 
                        startLatitude: Double, 
                        startLongitude: Double, 
                        startAddress: String, 
                        endLatitude: Double?, 
                        endLongitude: Double?, 
                        endAddress: String?, 
                        success: { (ride, response) in

                            // do something with the ride and response
                            // response will provide you the status code

}) { (err) in
    // do something with the err

We also provide taxiGo.api.startObservingStatus to observe the status of the ride you request. Remember to start the observing before you request the ride.
Sweet reminder: It will keep observing until you set the value as false.

taxiGo.api.startObservingStatus = true

If you start to observe the ride’s status, you’ll need to implement delegate: TaxiGoAPIDelegate to access the callback. It will update the status every 5 seconds.

taxiGo.api.taxiGoDelegate = self

extension ViewController: TaxiGoAPIDelegate {

    func rideDidUpdate(status: String, ride: TaxiGo.API.Ride) {

        // do somthing with the callback
        print(status) // ex. WAITING_SPECIFY



Cancel a ride

If you successfully request a ride, TaxiGoDev will save the ride’s id in

guard let token = taxiGo.auth.accessToken,
      let id = else { return }

taxiGo.api.cancelARide(withAccessToken: token, id: id, success: { (ride, response) in

    taxiGo.api.startObservingStatus = false
    // do something with the ride and response
    // response will provide the status code

}) { (err, response) in
    // do something with the err

Nearby drivers

Sweet reminder: Rate Limit – 5 calls per minute.

taxiGo.api.getNearbyDriver(withAccessToken: token,
                        lat: place.coordinate.latitude,
                        lng: place.coordinate.longitude,
                        success: { (nearbyDrivers, response) in

                            nearbyDrivers.forEach({ (driver) in

}, failure: { (err, response) in
    // do something with the err


taxiGo.api.getRiderInfo(withAccessToken: token, success: { (rider, response) in


            rider.favorite?.forEach({ (info) in

}) { (err, response) in
    // do something with the err


shannn214, [email protected]


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

Latest podspec

    "name": "TaxiGoDev",
    "version": "0.4.0",
    "summary": "Open API of TaxiGo.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "shannn214": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.4.0"
    "platforms": {
        "ios": "11.0"
    "source_files": "TaxiGoDev/Classes/",
    "dependencies": {
        "HandyJSON": [
            "~> 4.2.0-beta1"

Pin It on Pinterest

Share This