Giter VIP home page Giter VIP logo

gpuberview's Introduction

Note: Use This Instead!

Uber now has an official ride request widget. You should probably use it instead of this.

This repository is no longer being maintained.


GPUberView

Summon Uber from your iOS app with 2 lines of code.

GPUberView

Quick Start

#import <GPUberViewController.h>

// ...

GPUberViewController *uber = [[GPUberViewController alloc] initWithServerToken:@"your_server_token"];

// optional
uber.startLocation = CLLocationCoordinate2DMake(40.7471787,-73.997494);
uber.endLocation = CLLocationCoordinate2DMake(40.712774,-74.006059);

[uber showInViewController:self];

Demo

  1. Go to the GPUberViewDemo directory.
  2. Open the .xcworkspace (not the .xcodeproj) file.
  3. Run the app in the Simulator or on the device.

Note:

If the phone has the Uber app installed, tapping any of the Uber service buttons will bring it up with the appropriate parameters already set. Otherwise the Uber mobile website will be launched.

Adding GPUberView to Your Project

CocoaPods

platform :ios, '7.1'
pod "GPUberView"

Usage

Register You App With Uber

To use this library you need a valid Server Token from Uber. You can get it here: https://developer.uber.com

Add url schemes

For iOS 9 compatibility, add the following scheme to your application's info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>uber</string>
</array>

Import GPUberView

#import <GPUberViewController.h>

Initialize the GPUberViewController

Pass in your Uber server token for authentication.

GPUberViewController *uber = [[GPUberViewController alloc] initWithServerToken:@"your_server_token"];

(Optional) Specify the Pickup and/or Destination

You can pass-in the desired pickup and dropoff coordinates as CLLocationCoordinate2D structs.

// example: from Boston South Station to Fenway Park
uber.startLocation = CLLocationCoordinate2DMake(40.7471787,-73.997494);
uber.endLocation = CLLocationCoordinate2DMake(40.712774,-74.006059);
  • If you omit startLocation, GPUberView will attempt to determine it based on your user's current location. For iOS 8.0 and higher, this requires you to add the NSLocationWhenInUseUsageDescription key into your application's Info.plist file. The value should be a short string explaining the reason why your app needs location (e.g., "Uber needs to determine your pickup location.").

  • If you omit the endLocation, GPUberView will not be able to calculate the price estimate, but still will be able to show the estimated pickup time.

Note: If you supply both the pickup and dropoff locations, make sure the distance between the two isn't exceedingly large. Most Uber products cannot drive you from San Francisco to New York.

You can also pass in user-readable names of the pickup and dropoff points. These labels will be shown to the user as the pickup and dropoff labels in the Uber app once launched. If not supplied, GPUberView (or the Uber app itself) will attempt to determine these automatically.

uber.startName = @"South Station";
uber.endName = @"Fenway Park";

(Optional) Add Your Client Id

Add your Uber client id to receive Uber credits for new user signups. You can get it here: https://developer.uber.com

uber.clientId = @"your_client_id";

Show GPUberView

[uber showInViewController:self];

License

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

gpuberview's People

Contributors

bryant1410 avatar gpolak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpuberview's Issues

Changes to [UIApplication sharedApplication] canOpenURL in iOS 9

I jumped back into integrating this into an app today and noticed that canOpenURL no longer returns YES when an app is installed.

Apparently this is a change in iOS 9, where the scheme needs to be whitelisted in Info.plist.

Would it be possible be add this to the README?
Will submit PR if I've got some time ๐Ÿ˜Š

Source: http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes

EDIT: Looks like canOpenURL should just be openURL to solve this issue.

Need to upgrade the AFNetworking dependency

AFNetworking has been upgraded to 3.0 (where AFHTTPRequestOperationManager has been deprecated).

The AFNetworking dependency needs to upgraded to support the same. This will prevent errors with upgrading AFNetworking for use within our own apps as well.

INTULocationManager upgrade

Sorry for sounding like a broken record, but will it be possible to update the INTULocationManager dependency to 4.1.1 as well? I'm using INTULocationManager in my application as well, and an stuck with GPUberView version 0.5 when using pod install.

Though the AFNetworking dependency issue was solved, upgrading GPUberView now causes the following error:

$ pod update GPUberView

Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `INTULocationManager` required by `Podfile`
- `INTULocationManager (= 4.1.1)` required by `Podfile.lock`
- `INTULocationManager (~> 2.0)` required by `GPUberView (1.1.0)` 

Mobile Sign-Up No Longer Relevant

Hi there,

While integrating this control into my app, I noticed that the directing the user to m.uber.com with user parameters no longer works and instead jumps to the app store. While investigating I found that Uber had made this change a few months ago, mentioned below:

Within the next month, we will begin redirecting all desktop users from m.uber.com/sign-up to get.uber.com, while mobile users will be directed to the appropriate Uber app store page. You will not need to change your current m.uber signup link, but please make sure that you are not wrapping m.uber in a webview. In addition, rider promos will no longer be applied directly to users that come from developer apps.

Would it be safe to say that the user parameter function should be deprecated as it doesn't serve a purpose anymore?

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.