TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Mar 2015 |
Maintained by Unclaimed.
An AFOAuth1Client subclass for easily authenticating and using Tumblr.
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:^{
}];
}];
}
PJ Gray
AFTumblrAPIClient is available under the MIT license. See the LICENSE file for more info.