Latest1.0.0
Homepagehttps://github.com/m1entus/RWMVimeoClient
LicenseMIT
Platformsios 7.0, requires ARC
DependenciesAFNetworking
FrameworksQuartzCore

RWMViemoClient

RWMViemoClient is an AFHTTPRequestOperationManager subclass for interacting with the Vimeo Advanced API.

Example Usage

Register Custom Redirect URL Scheme in Info.plist

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>custom_scheme</string>
        </array>
    </dict>
</array>

OAuth Vimeo Authentication

[[RWMVimeoOperationManager sharedOperationManager] setClientId:@"YOUR_CLIENT_ID"
                                         secret:@"YOUR_SECRET"
                                    redirectURL:[NSURL URLWithString:@"custom_scheme://login"]];

// Check if authentication token was storen in user default
OAToken *token = [[OAToken alloc] initWithUserDefaultsUsingServiceProviderName:@"VimeoClient" prefix:@"RWM"];

if (token) {
    // Set authenticator token for API Calls
    [RWMVimeoOperationManager sharedOperationManager].authenticationToken = token;
    [self searchQuery];
} else {
    // Authenticate user
    [[RWMVimeoOperationManager sharedOperationManager] authenticateWithBlock:^(NSError *error) {
        if (error) {
            NSLog(@"%@",error);
        }
    }];
}

Handle OpenURL

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return [[RWMVimeoOperationManager sharedOperationManager] handleOpenURL:url fallbackHandler:^(OAToken *token, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
        } else {
            [token storeInUserDefaultsWithServiceProviderName:@"VimeoClient" prefix:@"RWM"];
            [self searchQuery];
        }
    }];
}

API Usage

NSDictionary *paramters = @{
                            @"page" : @2,
                            @"per_page" : @5,
                            @"query" : @"test",
                            @"full_response" : @1
                            };

[[RWMVimeoOperationManager sharedOperationManager] vimeoRequestOperationWithHTTPMethod:@"GET" APIMethod:@"vimeo.videos.search" parameters:paramters success:^(AFHTTPRequestOperation *operation, id responseObject) {

} failure:^(AFHTTPRequestOperation *operation, NSError *error) {

}];

Contact

MichaƂ Zaborowski

License

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

Bitdeli Badge

Latest podspec

{
    "name": "RWMVimeoClient",
    "version": "1.0.0",
    "license": "MIT",
    "summary": "UIAppearance proxy for custom objects.",
    "homepage": "https://github.com/m1entus/RWMVimeoClient",
    "authors": "Michau0142 Zaborowski",
    "source": {
        "git": "https://github.com/m1entus/RWMVimeoClient.git",
        "tag": "1.0.0"
    },
    "source_files": "Source/**/*.{h,m,c}",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "frameworks": "QuartzCore",
    "dependencies": {
        "AFNetworking": [
            "~> 2.2.2"
        ]
    }
}

Pin It on Pinterest

Share This