Latest 0.1.1
Homepage https://github.com/uberHackathon/UberOAuth2
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, CoreGraphics, UIKit
Authors

Pod Version
Pod Platform
Pod License

UberOAuth2 is a simple Objective-C wrapper for Uber OAuth2 login.

the Uber API url is Uber API .

UberOAuth2 is used for uber.com.cn,but also can be used for uber.com .and you need register uber developer , you need set
clientid and clientsecret,redirecturl,and so on.

Podfile

platform :ios, '7.0'
pod 'UberOAuth2', '~> 0.1.1'

Instruction

OAuth2 login

    UberLoginWebViewController *webViewController=[[UberLoginWebViewController alloc] init];
    NSString *urlString=[NSString stringWithFormat:@"https://login.uber.com.cn/oauth/v2/authorize?client_id=%@&redirect_url=%@&response_type=code&scope=profile history places history_lite",ClientId,RedirectUrl ];
    NSString *encodedUrlString = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    webViewController.urlString=encodedUrlString;
    webViewController.resultCallBack=^(NSDictionary *jsonDict, NSURLResponse *response, NSError *error){
        NSLog(@"access token %@ ",jsonDict);
    };
    [self presentViewController:webViewController animated:YES completion:nil];

get user profile through accesstoken

    [UberAPI requestUserProfileWithResult:^(NSDictionary *jsonDict, NSURLResponse *response, NSError *error){
        NSLog(@"user profile %@ ",jsonDict);
    }];

Uber OAuth2 Flow

UberOAuth2

Licenses

All source code is licensed under the MIT License.

Latest podspec

{
    "name": "UberOAuth2",
    "version": "0.1.1",
    "summary": "UberOAuth2 - UberOAuth2 is a simple Objective-C wrapper for Uber OAuth2 login.",
    "homepage": "https://github.com/uberHackathon/UberOAuth2",
    "license": "MIT",
    "authors": {
        "coderyi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/uberHackathon/UberOAuth2.git",
        "tag": "0.1.1"
    },
    "frameworks": [
        "Foundation",
        "CoreGraphics",
        "UIKit"
    ],
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "UberOAuth2/UberOAuth2/**/*.{h,m,png}",
    "requires_arc": true
}

Pin It on Pinterest

Share This