AFTumblrAPIClient 0.0.4

AFTumblrAPIClient 0.0.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Unclaimed.



  • By
  • PJ Gray

An AFOAuth1Client subclass for easily authenticating and using Tumblr.

Instructions

Register your application to launch from a custom URL scheme, and use that with the path /success as your callback URL.

Here's how it all looks together:

// First create the client
AFTumblrAPIClient* tumblrClient = [[AFTumblrAPIClient alloc] initWithKey:kTumblrAPITokenString
                                                                  secret:kTumblrAPISecretString
                                                       callbackUrlString:kTumblrCallbackURLString];


// Check if we previously authenticated
if ([tumblrClient isAuthenticated]) {

    // If so, just make a call
    [tumblrClient getBlogNamesWithSuccess:^(NSArray *blogsArray) {

        NSLog(@"BLOGS: %@", blogsArray);

    } withFailure:^{

    }];
} else {

    // If not, authenticate
    [tumblrClient authenticateWithCompletion:^{

        // Then make a call
        [tumblrClient getBlogNamesWithSuccess:^(NSArray *blogsArray) {

            NSLog(@"BLOGS: %@", blogsArray);

        } withFailure:^{

        }];
    }];
}

Contact

PJ Gray

License

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