PFLinkedInUtils
Overview
The PFLinkedInUtils class provides utility functions for working with LinkedIn in a Parse application.
This class is currently for iOS only.
Usage
Installation
PFLinkedInUtils is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "PFLinkedInUtils"
Or you can add the following files to your project:
PFLinkedInUtils.m
PFLinkedInUtils.h
And its dependencies:
To run the example project, clone the repo, and run pod install
from the Example directory first.
Example
[Parse setApplicationId:@"PARSE_APP_ID" clientKey:@"PARSE_CLIENT_SECRET"];
[PFLinkedInUtils initializeWithRedirectURL:@"LINKEDIN_REDIRECT_URL" clientId:@"LINKEDIN_CLIENT_ID" clientSecret:@"LINKEDIN_CLIENT_SECRET" state:@"DCEEFWF45453sdffef424" grantedAccess:@[@"r_fullprofile", @"r_network"] presentingViewController:nil];
[PFLinkedInUtils logInWithBlock:^(PFUser *user, NSError *error) {
NSLog(@"User: %@, Error: %@", user, error);
[self.linkedInHttpClient GET:@"LINKEDIN_API_URL" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"Response JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}];
Etc.
- Contributions are very welcome.
- Attribution is appreciated (let's spread the word!), but not mandatory.
Use it? Love/hate it?
Tweet the author @alexruperez, and check out alexruperez's blog: http://alexruperez.com
License
PFLinkedInUtils is available under the MIT license. See the LICENSE file for more info.