├── .gitignore
├── Example
├── IOSLinkedInAPI-Example
│ ├── .gitignore
│ ├── IOSLinkedInAPI-Example
│ │ ├── Default-568h@2x.png
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ ├── IOSLinkedInAPI-Example-Info.plist
│ │ ├── IOSLinkedInAPI-Example-Prefix.pch
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── LaunchImage.launchimage
│ │ │ │ └── Contents.json
│ │ ├── LIAAppDelegate.h
│ │ ├── LIAAppDelegate.m
│ │ ├── LIALinkedInExampleViewController.h
│ │ ├── LIALinkedInExampleViewController.m
│ │ ├── LIAViewController.h
│ │ ├── LIAViewController.m
│ │ ├── en.lproj
│ │ │ └── InfoPlist.strings
│ │ └── main.m
│ ├── IOSLinkedInAPI-ExampleTests
│ │ ├── IOSLinkedInAPI-ExampleTests-Info.plist
│ │ ├── IOSLinkedInAPI_ExampleTests.m
│ │ └── en.lproj
│ │ │ └── InfoPlist.strings
│ ├── Podfile
│ └── Podfile.lock
└── IOSLinkedInAPI-Podexample
│ └── IOSLinkedInAPI-Podexample
│ ├── .gitignore
│ ├── IOSLinkedInAPI-Podexample.xcodeproj
│ └── project.pbxproj
│ ├── IOSLinkedInAPI-Podexample
│ ├── .gitignore
│ ├── Base.lproj
│ │ ├── Main_iPad.storyboard
│ │ └── Main_iPhone.storyboard
│ ├── IOSLinkedInAPI-Podexample-Info.plist
│ ├── IOSLinkedInAPI-Podexample-Prefix.pch
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── LIAAppDelegate.h
│ ├── LIAAppDelegate.m
│ ├── LIAViewController.h
│ ├── LIAViewController.m
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ └── main.m
│ ├── IOSLinkedInAPI-PodexampleTests
│ ├── IOSLinkedInAPI-PodexampleTests-Info.plist
│ ├── IOSLinkedInAPI_PodexampleTests.m
│ └── en.lproj
│ │ └── InfoPlist.strings
│ ├── Podfile
│ └── Podfile.lock
├── IOSLinkedInAPI.podspec
├── IOSLinkedInAPI
├── LIALinkedInApplication.h
├── LIALinkedInApplication.m
├── LIALinkedInAuthorizationViewController.h
├── LIALinkedInAuthorizationViewController.m
├── LIALinkedInHttpClient.h
├── LIALinkedInHttpClient.m
├── NSString+LIAEncode.h
├── NSString+LIAEncode.m
└── Resources
│ ├── 01-refresh.png
│ └── 01-refresh@2x.png
├── LICENSE
├── README.md
└── gh-pages
├── authenticate-example-ipad.png
├── authenticate-example-iphone.png
└── authenticate-example.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 | .idea/
19 |
20 | Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example.xcodeproj/
21 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/.gitignore:
--------------------------------------------------------------------------------
1 | Pods/
2 | .idea
3 | IOSLinkedInAPI-Example/LIALinkedInClientExampleCredentials.h
4 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default-568h@2x.png
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default.png
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Default@2x.png
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CFBundleIdentifier
7 | com.ancientprogramming.${PRODUCT_NAME:rfc1034identifier}
8 |
9 | CFBundleDevelopmentRegion
10 | en
11 | CFBundleDisplayName
12 | ${PRODUCT_NAME}
13 | CFBundleExecutable
14 | ${EXECUTABLE_NAME}
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | ${PRODUCT_NAME}
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 1.0
27 | LSRequiresIPhoneOS
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_3_0
10 | #warning "This project uses features only available in iOS SDK 3.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIAAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // LIAAppDelegate.h
3 | // IOSLinkedInAPI-Example
4 | //
5 | // Created by Jacob von Eyben on 04/27/13.
6 | // Copyright (c) 2013 Ancientprogramming. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LIALinkedInExampleViewController.h"
11 |
12 |
13 |
14 | @interface LIAAppDelegate : UIResponder
15 |
16 | @property (strong, nonatomic) UIWindow *window;
17 |
18 | @property (strong, nonatomic) LIALinkedInExampleViewController *viewController;
19 |
20 | @end
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIAAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // LIAAppDelegate.m
3 | // IOSLinkedInAPI-Example
4 | //
5 | // Created by Jacob von Eyben on 04/27/13.
6 | // Copyright (c) 2013 Ancientprogramming. All rights reserved.
7 | //
8 |
9 | #import "LIAAppDelegate.h"
10 |
11 | @implementation LIAAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
14 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
15 | // Override point for customization after application launch.
16 |
17 |
18 | self.viewController = [[LIALinkedInExampleViewController alloc] init];
19 | self.window.rootViewController = self.viewController;
20 | [self.window makeKeyAndVisible];
21 | return YES;
22 | }
23 |
24 | @end
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIALinkedInExampleViewController.h:
--------------------------------------------------------------------------------
1 | // LIALinkedInApplication.h
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | #import
23 |
24 |
25 | @interface LIALinkedInExampleViewController : UIViewController
26 | @end
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIALinkedInExampleViewController.m:
--------------------------------------------------------------------------------
1 | // LIALinkedInApplication.h
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | #import "LIALinkedInExampleViewController.h"
23 | #import "LIALinkedInApplication.h"
24 | #import "LIALinkedInHttpClient.h"
25 | #import "LIALinkedInClientExampleCredentials.h"
26 |
27 |
28 | @implementation LIALinkedInExampleViewController {
29 | UIButton *_requestLinkedInTokenButton;
30 | LIALinkedInHttpClient *_client;
31 |
32 | }
33 |
34 | - (void)viewDidLoad {
35 | [super viewDidLoad];
36 | _client = [self client];
37 | self.view.backgroundColor = [UIColor whiteColor];
38 | _requestLinkedInTokenButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
39 | [_requestLinkedInTokenButton setTitle:@"Request token" forState:UIControlStateNormal];
40 | _requestLinkedInTokenButton.frame = CGRectMake(0, 0, 200, 44);
41 | _requestLinkedInTokenButton.center = self.view.center;
42 | [self.view addSubview:_requestLinkedInTokenButton];
43 | [_requestLinkedInTokenButton addTarget:self action:@selector(didRequestAuthToken) forControlEvents:UIControlEventTouchUpInside];
44 | }
45 |
46 | - (void)viewWillLayoutSubviews {
47 | [super viewWillLayoutSubviews];
48 | _requestLinkedInTokenButton.center = self.view.center;
49 | }
50 |
51 |
52 | - (void)didRequestAuthToken {
53 |
54 | if ([_client validToken]) {
55 | [self requestMeWithToken:[_client accessToken]];
56 | } else {
57 | [_client getAuthorizationCode:^(NSString *code) {
58 | [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
59 | NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
60 | [self requestMeWithToken:accessToken];
61 | } failure:^(NSError *error) {
62 | NSLog(@"Quering accessToken failed %@", error);
63 | }];
64 | } cancel:^{
65 | NSLog(@"Authorization was cancelled by user");
66 | } failure:^(NSError *error) {
67 | NSLog(@"Authorization failed %@", error);
68 | }];
69 | }
70 | }
71 |
72 | - (void)requestMeWithToken:(NSString *)accessToken {
73 | [self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
74 | NSLog(@"current user %@", result);
75 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
76 | NSLog(@"failed to fetch current user %@", error);
77 | }];
78 | }
79 |
80 | - (LIALinkedInHttpClient *)client {
81 | LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.ancientprogramming.com/liaexample"
82 | clientId:LINKEDIN_CLIENT_ID
83 | clientSecret:LINKEDIN_CLIENT_SECRET
84 | state:@"DCEEFWF45453sdffef424"
85 | grantedAccess:@[@"r_fullprofile", @"r_network"]];
86 | return [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
87 | }
88 |
89 |
90 | @end
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIAViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LIAViewController.h
3 | // IOSLinkedInAPI-Example
4 | //
5 | // Created by Jacob von Eyben on 04/27/13.
6 | // Copyright (c) 2013 Ancientprogramming. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LIAViewController : UIViewController
12 |
13 | @end
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/LIAViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LIAViewController.m
3 | // IOSLinkedInAPI-Example
4 | //
5 | // Created by Jacob von Eyben on 04/27/13.
6 | // Copyright (c) 2013 Ancientprogramming. All rights reserved.
7 | //
8 |
9 | #import "LIAViewController.h"
10 | #import "LIALinkedInHttpClient.h"
11 | #import "LIALinkedInApplication.h"
12 | #import "LIALinkedInClientExampleCredentials.h"
13 | #import "AFHTTPRequestOperation.h"
14 |
15 | @interface LIAViewController ()
16 |
17 | @property(nonatomic, strong) LIALinkedInHttpClient *client;
18 | @end
19 |
20 | @implementation LIAViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | NSArray *grantedAccess = @[@"r_fullprofile", @"r_network"];
26 |
27 | //load the the secret data from an uncommitted LIALinkedInClientExampleCredentials.h file
28 | NSString *clientId = LINKEDIN_CLIENT_ID; //the client secret you get from the registered LinkedIn application
29 | NSString *clientSecret = LINKEDIN_CLIENT_SECRET; //the client secret you get from the registered LinkedIn application
30 | NSString *state = @"DCEEFWF45453sdffef424"; //A long unique string value of your choice that is hard to guess. Used to prevent CSRF
31 | LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.ancientprogramming.com" clientId:clientId clientSecret:clientSecret state:state grantedAccess:grantedAccess];
32 | self.client = [LIALinkedInHttpClient clientForApplication:application];
33 |
34 | UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
35 | loginButton.frame = CGRectMake(0, 0, 300, 44);
36 | loginButton.center = CGPointMake(CGRectGetMidX(self.view.frame), 50);
37 | [loginButton setTitle:@"Login to LinkedIn" forState:UIControlStateNormal];
38 | [self.view addSubview:loginButton];
39 |
40 | [loginButton addTarget:self action:@selector(didPressLogin:) forControlEvents:UIControlEventTouchUpInside];
41 | }
42 |
43 | - (void)didPressLogin:(id)sender {
44 | NSLog(@"did press login");
45 | [self.client getAuthorizationCode:^(NSString *code) {
46 | [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
47 | NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
48 | [self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
49 | NSLog(@"current user %@", result);
50 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
51 | NSLog(@"failed to fetch current user %@", error);
52 | }];
53 | } failure:^(NSError *error) {
54 | NSLog(@"Quering accessToken failed %@", error);
55 | }];
56 | } cancel:^{
57 | NSLog(@"Authorization was cancelled by user");
58 | } failure:^(NSError *error) {
59 | NSLog(@"Authorization failed %@", error);
60 | }];
61 |
62 | }
63 |
64 | - (void)didReceiveMemoryWarning {
65 | [super didReceiveMemoryWarning];
66 | // Dispose of any resources that can be recreated.
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-Example/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // IOSLinkedInAPI-Example
4 | //
5 | // Created by Jacob von Eyben on 04/27/13.
6 | // Copyright (c) 2013 Ancientprogramming. All rights reserved.
7 | //
8 |
9 |
10 | #import "LIAAppDelegate.h"
11 |
12 | int main(int argc, char *argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LIAAppDelegate class]));
16 | }
17 | }
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-ExampleTests/IOSLinkedInAPI-ExampleTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.eybenconsult.linkedin.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-ExampleTests/IOSLinkedInAPI_ExampleTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // IOSLinkedInAPI_ExampleTests.m
3 | // IOSLinkedInAPI-ExampleTests
4 | //
5 | // Created by Jacob von Eyben on 05/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IOSLinkedInAPI_ExampleTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation IOSLinkedInAPI_ExampleTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/IOSLinkedInAPI-ExampleTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '6.0'
2 | pod 'AFNetworking', '~> 2.0.3'
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (2.0.3):
3 | - AFNetworking/NSURLConnection
4 | - AFNetworking/NSURLSession
5 | - AFNetworking/Reachability
6 | - AFNetworking/Security
7 | - AFNetworking/Serialization
8 | - AFNetworking/UIKit
9 | - AFNetworking/NSURLConnection (2.0.3):
10 | - AFNetworking/Reachability
11 | - AFNetworking/Security
12 | - AFNetworking/Serialization
13 | - AFNetworking/NSURLSession (2.0.3):
14 | - AFNetworking/NSURLConnection
15 | - AFNetworking/Reachability (2.0.3)
16 | - AFNetworking/Security (2.0.3)
17 | - AFNetworking/Serialization (2.0.3)
18 | - AFNetworking/UIKit (2.0.3):
19 | - AFNetworking/NSURLConnection
20 |
21 | DEPENDENCIES:
22 | - AFNetworking (~> 2.0.3)
23 |
24 | SPEC CHECKSUMS:
25 | AFNetworking: e499052cbf3d743e9bb727bb37adb9dc2547ba15
26 |
27 | COCOAPODS: 0.27.1
28 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | Pods
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 16AD612F556B4B92ADB38EEF /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35282DA869D54E88A071E44A /* libPods.a */; };
11 | 33AE657C185FA2E400981915 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE657B185FA2E400981915 /* Foundation.framework */; };
12 | 33AE657E185FA2E400981915 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE657D185FA2E400981915 /* CoreGraphics.framework */; };
13 | 33AE6580185FA2E400981915 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE657F185FA2E400981915 /* UIKit.framework */; };
14 | 33AE6586185FA2E400981915 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33AE6584185FA2E400981915 /* InfoPlist.strings */; };
15 | 33AE6588185FA2E400981915 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AE6587185FA2E400981915 /* main.m */; };
16 | 33AE658C185FA2E400981915 /* LIAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AE658B185FA2E400981915 /* LIAAppDelegate.m */; };
17 | 33AE658F185FA2E400981915 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 33AE658D185FA2E400981915 /* Main_iPhone.storyboard */; };
18 | 33AE6592185FA2E400981915 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 33AE6590185FA2E400981915 /* Main_iPad.storyboard */; };
19 | 33AE6595185FA2E400981915 /* LIAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AE6594185FA2E400981915 /* LIAViewController.m */; };
20 | 33AE6597185FA2E400981915 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33AE6596185FA2E400981915 /* Images.xcassets */; };
21 | 33AE659E185FA2E500981915 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE659D185FA2E400981915 /* XCTest.framework */; };
22 | 33AE659F185FA2E500981915 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE657B185FA2E400981915 /* Foundation.framework */; };
23 | 33AE65A0185FA2E500981915 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AE657F185FA2E400981915 /* UIKit.framework */; };
24 | 33AE65A8185FA2E500981915 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33AE65A6185FA2E500981915 /* InfoPlist.strings */; };
25 | 33AE65AA185FA2E500981915 /* IOSLinkedInAPI_PodexampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AE65A9185FA2E500981915 /* IOSLinkedInAPI_PodexampleTests.m */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXContainerItemProxy section */
29 | 33AE65A1185FA2E500981915 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 33AE6570185FA2E400981915 /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 33AE6577185FA2E400981915;
34 | remoteInfo = "IOSLinkedInAPI-Podexample";
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 33AE6578185FA2E400981915 /* IOSLinkedInAPI-Podexample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "IOSLinkedInAPI-Podexample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 33AE657B185FA2E400981915 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
41 | 33AE657D185FA2E400981915 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
42 | 33AE657F185FA2E400981915 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
43 | 33AE6583185FA2E400981915 /* IOSLinkedInAPI-Podexample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IOSLinkedInAPI-Podexample-Info.plist"; sourceTree = ""; };
44 | 33AE6585185FA2E400981915 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
45 | 33AE6587185FA2E400981915 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
46 | 33AE6589185FA2E400981915 /* IOSLinkedInAPI-Podexample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IOSLinkedInAPI-Podexample-Prefix.pch"; sourceTree = ""; };
47 | 33AE658A185FA2E400981915 /* LIAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LIAAppDelegate.h; sourceTree = ""; };
48 | 33AE658B185FA2E400981915 /* LIAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LIAAppDelegate.m; sourceTree = ""; };
49 | 33AE658E185FA2E400981915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; };
50 | 33AE6591185FA2E400981915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; };
51 | 33AE6593185FA2E400981915 /* LIAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LIAViewController.h; sourceTree = ""; };
52 | 33AE6594185FA2E400981915 /* LIAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LIAViewController.m; sourceTree = ""; };
53 | 33AE6596185FA2E400981915 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
54 | 33AE659C185FA2E400981915 /* IOSLinkedInAPI-PodexampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IOSLinkedInAPI-PodexampleTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 33AE659D185FA2E400981915 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
56 | 33AE65A5185FA2E500981915 /* IOSLinkedInAPI-PodexampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IOSLinkedInAPI-PodexampleTests-Info.plist"; sourceTree = ""; };
57 | 33AE65A7185FA2E500981915 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
58 | 33AE65A9185FA2E500981915 /* IOSLinkedInAPI_PodexampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IOSLinkedInAPI_PodexampleTests.m; sourceTree = ""; };
59 | 35282DA869D54E88A071E44A /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
60 | 8B150E210F374D749A42FD73 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; };
61 | E0CD15D06FF04FF5977479E5 /* Pods-IOSLinkedInAPI-Podexample.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IOSLinkedInAPI-Podexample.xcconfig"; path = "Pods/Pods-IOSLinkedInAPI-Podexample.xcconfig"; sourceTree = ""; };
62 | /* End PBXFileReference section */
63 |
64 | /* Begin PBXFrameworksBuildPhase section */
65 | 33AE6575185FA2E400981915 /* Frameworks */ = {
66 | isa = PBXFrameworksBuildPhase;
67 | buildActionMask = 2147483647;
68 | files = (
69 | 33AE657E185FA2E400981915 /* CoreGraphics.framework in Frameworks */,
70 | 33AE6580185FA2E400981915 /* UIKit.framework in Frameworks */,
71 | 33AE657C185FA2E400981915 /* Foundation.framework in Frameworks */,
72 | 16AD612F556B4B92ADB38EEF /* libPods.a in Frameworks */,
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 33AE6599185FA2E400981915 /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | 33AE659E185FA2E500981915 /* XCTest.framework in Frameworks */,
81 | 33AE65A0185FA2E500981915 /* UIKit.framework in Frameworks */,
82 | 33AE659F185FA2E500981915 /* Foundation.framework in Frameworks */,
83 | );
84 | runOnlyForDeploymentPostprocessing = 0;
85 | };
86 | /* End PBXFrameworksBuildPhase section */
87 |
88 | /* Begin PBXGroup section */
89 | 33AE656F185FA2E400981915 = {
90 | isa = PBXGroup;
91 | children = (
92 | 33AE6581185FA2E400981915 /* IOSLinkedInAPI-Podexample */,
93 | 33AE65A3185FA2E500981915 /* IOSLinkedInAPI-PodexampleTests */,
94 | 33AE657A185FA2E400981915 /* Frameworks */,
95 | 33AE6579185FA2E400981915 /* Products */,
96 | E0CD15D06FF04FF5977479E5 /* Pods-IOSLinkedInAPI-Podexample.xcconfig */,
97 | 8B150E210F374D749A42FD73 /* Pods.xcconfig */,
98 | );
99 | sourceTree = "";
100 | };
101 | 33AE6579185FA2E400981915 /* Products */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 33AE6578185FA2E400981915 /* IOSLinkedInAPI-Podexample.app */,
105 | 33AE659C185FA2E400981915 /* IOSLinkedInAPI-PodexampleTests.xctest */,
106 | );
107 | name = Products;
108 | sourceTree = "";
109 | };
110 | 33AE657A185FA2E400981915 /* Frameworks */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 33AE657B185FA2E400981915 /* Foundation.framework */,
114 | 33AE657D185FA2E400981915 /* CoreGraphics.framework */,
115 | 33AE657F185FA2E400981915 /* UIKit.framework */,
116 | 33AE659D185FA2E400981915 /* XCTest.framework */,
117 | 35282DA869D54E88A071E44A /* libPods.a */,
118 | );
119 | name = Frameworks;
120 | sourceTree = "";
121 | };
122 | 33AE6581185FA2E400981915 /* IOSLinkedInAPI-Podexample */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 33AE658A185FA2E400981915 /* LIAAppDelegate.h */,
126 | 33AE658B185FA2E400981915 /* LIAAppDelegate.m */,
127 | 33AE658D185FA2E400981915 /* Main_iPhone.storyboard */,
128 | 33AE6590185FA2E400981915 /* Main_iPad.storyboard */,
129 | 33AE6593185FA2E400981915 /* LIAViewController.h */,
130 | 33AE6594185FA2E400981915 /* LIAViewController.m */,
131 | 33AE6596185FA2E400981915 /* Images.xcassets */,
132 | 33AE6582185FA2E400981915 /* Supporting Files */,
133 | );
134 | path = "IOSLinkedInAPI-Podexample";
135 | sourceTree = "";
136 | };
137 | 33AE6582185FA2E400981915 /* Supporting Files */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 33AE6583185FA2E400981915 /* IOSLinkedInAPI-Podexample-Info.plist */,
141 | 33AE6584185FA2E400981915 /* InfoPlist.strings */,
142 | 33AE6587185FA2E400981915 /* main.m */,
143 | 33AE6589185FA2E400981915 /* IOSLinkedInAPI-Podexample-Prefix.pch */,
144 | );
145 | name = "Supporting Files";
146 | sourceTree = "";
147 | };
148 | 33AE65A3185FA2E500981915 /* IOSLinkedInAPI-PodexampleTests */ = {
149 | isa = PBXGroup;
150 | children = (
151 | 33AE65A9185FA2E500981915 /* IOSLinkedInAPI_PodexampleTests.m */,
152 | 33AE65A4185FA2E500981915 /* Supporting Files */,
153 | );
154 | path = "IOSLinkedInAPI-PodexampleTests";
155 | sourceTree = "";
156 | };
157 | 33AE65A4185FA2E500981915 /* Supporting Files */ = {
158 | isa = PBXGroup;
159 | children = (
160 | 33AE65A5185FA2E500981915 /* IOSLinkedInAPI-PodexampleTests-Info.plist */,
161 | 33AE65A6185FA2E500981915 /* InfoPlist.strings */,
162 | );
163 | name = "Supporting Files";
164 | sourceTree = "";
165 | };
166 | /* End PBXGroup section */
167 |
168 | /* Begin PBXNativeTarget section */
169 | 33AE6577185FA2E400981915 /* IOSLinkedInAPI-Podexample */ = {
170 | isa = PBXNativeTarget;
171 | buildConfigurationList = 33AE65AD185FA2E500981915 /* Build configuration list for PBXNativeTarget "IOSLinkedInAPI-Podexample" */;
172 | buildPhases = (
173 | BE9A50A3C7A2490586DD39FD /* Check Pods Manifest.lock */,
174 | 33AE6574185FA2E400981915 /* Sources */,
175 | 33AE6575185FA2E400981915 /* Frameworks */,
176 | 33AE6576185FA2E400981915 /* Resources */,
177 | BFDEFDA90B3B423FB67E3AFD /* Copy Pods Resources */,
178 | );
179 | buildRules = (
180 | );
181 | dependencies = (
182 | );
183 | name = "IOSLinkedInAPI-Podexample";
184 | productName = "IOSLinkedInAPI-Podexample";
185 | productReference = 33AE6578185FA2E400981915 /* IOSLinkedInAPI-Podexample.app */;
186 | productType = "com.apple.product-type.application";
187 | };
188 | 33AE659B185FA2E400981915 /* IOSLinkedInAPI-PodexampleTests */ = {
189 | isa = PBXNativeTarget;
190 | buildConfigurationList = 33AE65B0185FA2E500981915 /* Build configuration list for PBXNativeTarget "IOSLinkedInAPI-PodexampleTests" */;
191 | buildPhases = (
192 | 33AE6598185FA2E400981915 /* Sources */,
193 | 33AE6599185FA2E400981915 /* Frameworks */,
194 | 33AE659A185FA2E400981915 /* Resources */,
195 | );
196 | buildRules = (
197 | );
198 | dependencies = (
199 | 33AE65A2185FA2E500981915 /* PBXTargetDependency */,
200 | );
201 | name = "IOSLinkedInAPI-PodexampleTests";
202 | productName = "IOSLinkedInAPI-PodexampleTests";
203 | productReference = 33AE659C185FA2E400981915 /* IOSLinkedInAPI-PodexampleTests.xctest */;
204 | productType = "com.apple.product-type.bundle.unit-test";
205 | };
206 | /* End PBXNativeTarget section */
207 |
208 | /* Begin PBXProject section */
209 | 33AE6570185FA2E400981915 /* Project object */ = {
210 | isa = PBXProject;
211 | attributes = {
212 | CLASSPREFIX = LIA;
213 | LastUpgradeCheck = 0500;
214 | ORGANIZATIONNAME = "Eyben Consult ApS";
215 | TargetAttributes = {
216 | 33AE659B185FA2E400981915 = {
217 | TestTargetID = 33AE6577185FA2E400981915 /* IOSLinkedInAPI-Podexample */;
218 | };
219 | };
220 | };
221 | buildConfigurationList = 33AE6573185FA2E400981915 /* Build configuration list for PBXProject "IOSLinkedInAPI-Podexample" */;
222 | compatibilityVersion = "Xcode 3.2";
223 | developmentRegion = English;
224 | hasScannedForEncodings = 0;
225 | knownRegions = (
226 | en,
227 | Base,
228 | );
229 | mainGroup = 33AE656F185FA2E400981915;
230 | productRefGroup = 33AE6579185FA2E400981915 /* Products */;
231 | projectDirPath = "";
232 | projectReferences = (
233 | );
234 | projectRoot = "";
235 | targets = (
236 | 33AE6577185FA2E400981915 /* IOSLinkedInAPI-Podexample */,
237 | 33AE659B185FA2E400981915 /* IOSLinkedInAPI-PodexampleTests */,
238 | );
239 | };
240 | /* End PBXProject section */
241 |
242 | /* Begin PBXResourcesBuildPhase section */
243 | 33AE6576185FA2E400981915 /* Resources */ = {
244 | isa = PBXResourcesBuildPhase;
245 | buildActionMask = 2147483647;
246 | files = (
247 | 33AE6592185FA2E400981915 /* Main_iPad.storyboard in Resources */,
248 | 33AE6597185FA2E400981915 /* Images.xcassets in Resources */,
249 | 33AE658F185FA2E400981915 /* Main_iPhone.storyboard in Resources */,
250 | 33AE6586185FA2E400981915 /* InfoPlist.strings in Resources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | 33AE659A185FA2E400981915 /* Resources */ = {
255 | isa = PBXResourcesBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | 33AE65A8185FA2E500981915 /* InfoPlist.strings in Resources */,
259 | );
260 | runOnlyForDeploymentPostprocessing = 0;
261 | };
262 | /* End PBXResourcesBuildPhase section */
263 |
264 | /* Begin PBXShellScriptBuildPhase section */
265 | BE9A50A3C7A2490586DD39FD /* Check Pods Manifest.lock */ = {
266 | isa = PBXShellScriptBuildPhase;
267 | buildActionMask = 2147483647;
268 | files = (
269 | );
270 | inputPaths = (
271 | );
272 | name = "Check Pods Manifest.lock";
273 | outputPaths = (
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | shellPath = /bin/sh;
277 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
278 | showEnvVarsInLog = 0;
279 | };
280 | BFDEFDA90B3B423FB67E3AFD /* Copy Pods Resources */ = {
281 | isa = PBXShellScriptBuildPhase;
282 | buildActionMask = 2147483647;
283 | files = (
284 | );
285 | inputPaths = (
286 | );
287 | name = "Copy Pods Resources";
288 | outputPaths = (
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | shellPath = /bin/sh;
292 | shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n";
293 | showEnvVarsInLog = 0;
294 | };
295 | /* End PBXShellScriptBuildPhase section */
296 |
297 | /* Begin PBXSourcesBuildPhase section */
298 | 33AE6574185FA2E400981915 /* Sources */ = {
299 | isa = PBXSourcesBuildPhase;
300 | buildActionMask = 2147483647;
301 | files = (
302 | 33AE6588185FA2E400981915 /* main.m in Sources */,
303 | 33AE658C185FA2E400981915 /* LIAAppDelegate.m in Sources */,
304 | 33AE6595185FA2E400981915 /* LIAViewController.m in Sources */,
305 | );
306 | runOnlyForDeploymentPostprocessing = 0;
307 | };
308 | 33AE6598185FA2E400981915 /* Sources */ = {
309 | isa = PBXSourcesBuildPhase;
310 | buildActionMask = 2147483647;
311 | files = (
312 | 33AE65AA185FA2E500981915 /* IOSLinkedInAPI_PodexampleTests.m in Sources */,
313 | );
314 | runOnlyForDeploymentPostprocessing = 0;
315 | };
316 | /* End PBXSourcesBuildPhase section */
317 |
318 | /* Begin PBXTargetDependency section */
319 | 33AE65A2185FA2E500981915 /* PBXTargetDependency */ = {
320 | isa = PBXTargetDependency;
321 | target = 33AE6577185FA2E400981915 /* IOSLinkedInAPI-Podexample */;
322 | targetProxy = 33AE65A1185FA2E500981915 /* PBXContainerItemProxy */;
323 | };
324 | /* End PBXTargetDependency section */
325 |
326 | /* Begin PBXVariantGroup section */
327 | 33AE6584185FA2E400981915 /* InfoPlist.strings */ = {
328 | isa = PBXVariantGroup;
329 | children = (
330 | 33AE6585185FA2E400981915 /* en */,
331 | );
332 | name = InfoPlist.strings;
333 | sourceTree = "";
334 | };
335 | 33AE658D185FA2E400981915 /* Main_iPhone.storyboard */ = {
336 | isa = PBXVariantGroup;
337 | children = (
338 | 33AE658E185FA2E400981915 /* Base */,
339 | );
340 | name = Main_iPhone.storyboard;
341 | sourceTree = "";
342 | };
343 | 33AE6590185FA2E400981915 /* Main_iPad.storyboard */ = {
344 | isa = PBXVariantGroup;
345 | children = (
346 | 33AE6591185FA2E400981915 /* Base */,
347 | );
348 | name = Main_iPad.storyboard;
349 | sourceTree = "";
350 | };
351 | 33AE65A6185FA2E500981915 /* InfoPlist.strings */ = {
352 | isa = PBXVariantGroup;
353 | children = (
354 | 33AE65A7185FA2E500981915 /* en */,
355 | );
356 | name = InfoPlist.strings;
357 | sourceTree = "";
358 | };
359 | /* End PBXVariantGroup section */
360 |
361 | /* Begin XCBuildConfiguration section */
362 | 33AE65AB185FA2E500981915 /* Debug */ = {
363 | isa = XCBuildConfiguration;
364 | buildSettings = {
365 | ALWAYS_SEARCH_USER_PATHS = NO;
366 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
368 | CLANG_CXX_LIBRARY = "libc++";
369 | CLANG_ENABLE_MODULES = YES;
370 | CLANG_ENABLE_OBJC_ARC = YES;
371 | CLANG_WARN_BOOL_CONVERSION = YES;
372 | CLANG_WARN_CONSTANT_CONVERSION = YES;
373 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
374 | CLANG_WARN_EMPTY_BODY = YES;
375 | CLANG_WARN_ENUM_CONVERSION = YES;
376 | CLANG_WARN_INT_CONVERSION = YES;
377 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
379 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
380 | COPY_PHASE_STRIP = NO;
381 | GCC_C_LANGUAGE_STANDARD = gnu99;
382 | GCC_DYNAMIC_NO_PIC = NO;
383 | GCC_OPTIMIZATION_LEVEL = 0;
384 | GCC_PREPROCESSOR_DEFINITIONS = (
385 | "DEBUG=1",
386 | "$(inherited)",
387 | );
388 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
391 | GCC_WARN_UNDECLARED_SELECTOR = YES;
392 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
393 | GCC_WARN_UNUSED_FUNCTION = YES;
394 | GCC_WARN_UNUSED_VARIABLE = YES;
395 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
396 | ONLY_ACTIVE_ARCH = YES;
397 | SDKROOT = iphoneos;
398 | TARGETED_DEVICE_FAMILY = "1,2";
399 | };
400 | name = Debug;
401 | };
402 | 33AE65AC185FA2E500981915 /* Release */ = {
403 | isa = XCBuildConfiguration;
404 | buildSettings = {
405 | ALWAYS_SEARCH_USER_PATHS = NO;
406 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
408 | CLANG_CXX_LIBRARY = "libc++";
409 | CLANG_ENABLE_MODULES = YES;
410 | CLANG_ENABLE_OBJC_ARC = YES;
411 | CLANG_WARN_BOOL_CONVERSION = YES;
412 | CLANG_WARN_CONSTANT_CONVERSION = YES;
413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
414 | CLANG_WARN_EMPTY_BODY = YES;
415 | CLANG_WARN_ENUM_CONVERSION = YES;
416 | CLANG_WARN_INT_CONVERSION = YES;
417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
420 | COPY_PHASE_STRIP = YES;
421 | ENABLE_NS_ASSERTIONS = NO;
422 | GCC_C_LANGUAGE_STANDARD = gnu99;
423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
425 | GCC_WARN_UNDECLARED_SELECTOR = YES;
426 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
427 | GCC_WARN_UNUSED_FUNCTION = YES;
428 | GCC_WARN_UNUSED_VARIABLE = YES;
429 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
430 | SDKROOT = iphoneos;
431 | TARGETED_DEVICE_FAMILY = "1,2";
432 | VALIDATE_PRODUCT = YES;
433 | };
434 | name = Release;
435 | };
436 | 33AE65AE185FA2E500981915 /* Debug */ = {
437 | isa = XCBuildConfiguration;
438 | baseConfigurationReference = 8B150E210F374D749A42FD73 /* Pods.xcconfig */;
439 | buildSettings = {
440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
441 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
442 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
443 | GCC_PREFIX_HEADER = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Prefix.pch";
444 | INFOPLIST_FILE = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Info.plist";
445 | PRODUCT_NAME = "$(TARGET_NAME)";
446 | WRAPPER_EXTENSION = app;
447 | };
448 | name = Debug;
449 | };
450 | 33AE65AF185FA2E500981915 /* Release */ = {
451 | isa = XCBuildConfiguration;
452 | baseConfigurationReference = 8B150E210F374D749A42FD73 /* Pods.xcconfig */;
453 | buildSettings = {
454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
455 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
456 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
457 | GCC_PREFIX_HEADER = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Prefix.pch";
458 | INFOPLIST_FILE = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Info.plist";
459 | PRODUCT_NAME = "$(TARGET_NAME)";
460 | WRAPPER_EXTENSION = app;
461 | };
462 | name = Release;
463 | };
464 | 33AE65B1185FA2E500981915 /* Debug */ = {
465 | isa = XCBuildConfiguration;
466 | buildSettings = {
467 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
468 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOSLinkedInAPI-Podexample.app/IOSLinkedInAPI-Podexample";
469 | FRAMEWORK_SEARCH_PATHS = (
470 | "$(SDKROOT)/Developer/Library/Frameworks",
471 | "$(inherited)",
472 | "$(DEVELOPER_FRAMEWORKS_DIR)",
473 | );
474 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
475 | GCC_PREFIX_HEADER = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Prefix.pch";
476 | GCC_PREPROCESSOR_DEFINITIONS = (
477 | "DEBUG=1",
478 | "$(inherited)",
479 | );
480 | INFOPLIST_FILE = "IOSLinkedInAPI-PodexampleTests/IOSLinkedInAPI-PodexampleTests-Info.plist";
481 | PRODUCT_NAME = "$(TARGET_NAME)";
482 | TEST_HOST = "$(BUNDLE_LOADER)";
483 | WRAPPER_EXTENSION = xctest;
484 | };
485 | name = Debug;
486 | };
487 | 33AE65B2185FA2E500981915 /* Release */ = {
488 | isa = XCBuildConfiguration;
489 | buildSettings = {
490 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
491 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOSLinkedInAPI-Podexample.app/IOSLinkedInAPI-Podexample";
492 | FRAMEWORK_SEARCH_PATHS = (
493 | "$(SDKROOT)/Developer/Library/Frameworks",
494 | "$(inherited)",
495 | "$(DEVELOPER_FRAMEWORKS_DIR)",
496 | );
497 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
498 | GCC_PREFIX_HEADER = "IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Prefix.pch";
499 | INFOPLIST_FILE = "IOSLinkedInAPI-PodexampleTests/IOSLinkedInAPI-PodexampleTests-Info.plist";
500 | PRODUCT_NAME = "$(TARGET_NAME)";
501 | TEST_HOST = "$(BUNDLE_LOADER)";
502 | WRAPPER_EXTENSION = xctest;
503 | };
504 | name = Release;
505 | };
506 | /* End XCBuildConfiguration section */
507 |
508 | /* Begin XCConfigurationList section */
509 | 33AE6573185FA2E400981915 /* Build configuration list for PBXProject "IOSLinkedInAPI-Podexample" */ = {
510 | isa = XCConfigurationList;
511 | buildConfigurations = (
512 | 33AE65AB185FA2E500981915 /* Debug */,
513 | 33AE65AC185FA2E500981915 /* Release */,
514 | );
515 | defaultConfigurationIsVisible = 0;
516 | defaultConfigurationName = Release;
517 | };
518 | 33AE65AD185FA2E500981915 /* Build configuration list for PBXNativeTarget "IOSLinkedInAPI-Podexample" */ = {
519 | isa = XCConfigurationList;
520 | buildConfigurations = (
521 | 33AE65AE185FA2E500981915 /* Debug */,
522 | 33AE65AF185FA2E500981915 /* Release */,
523 | );
524 | defaultConfigurationIsVisible = 0;
525 | };
526 | 33AE65B0185FA2E500981915 /* Build configuration list for PBXNativeTarget "IOSLinkedInAPI-PodexampleTests" */ = {
527 | isa = XCConfigurationList;
528 | buildConfigurations = (
529 | 33AE65B1185FA2E500981915 /* Debug */,
530 | 33AE65B2185FA2E500981915 /* Release */,
531 | );
532 | defaultConfigurationIsVisible = 0;
533 | };
534 | /* End XCConfigurationList section */
535 | };
536 | rootObject = 33AE6570185FA2E400981915 /* Project object */;
537 | }
538 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/.gitignore:
--------------------------------------------------------------------------------
1 | LIALinkedInClientExampleCredentials.h
2 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Base.lproj/Main_iPad.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Base.lproj/Main_iPhone.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.eybenconsult.linkedin.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main_iPhone
29 | UIMainStoryboardFile~ipad
30 | Main_iPad
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/LIAAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // LIAAppDelegate.h
3 | // IOSLinkedInAPI-Podexample
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LIAAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/LIAAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // LIAAppDelegate.m
3 | // IOSLinkedInAPI-Podexample
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import "LIAAppDelegate.h"
10 |
11 | @implementation LIAAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/LIAViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LIAViewController.h
3 | // IOSLinkedInAPI-Podexample
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LIAViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/LIAViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LIAViewController.m
3 | // IOSLinkedInAPI-Podexample
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import "LIAViewController.h"
10 | #import "AFHTTPRequestOperation.h"
11 | #import "LIALinkedInHttpClient.h"
12 | #import "LIALinkedInClientExampleCredentials.h"
13 | #import "LIALinkedInApplication.h"
14 |
15 | @interface LIAViewController ()
16 |
17 | @end
18 |
19 | @implementation LIAViewController {
20 | LIALinkedInHttpClient *_client;
21 | }
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | _client = [self client];
26 | }
27 |
28 |
29 | - (IBAction)didTapConnectWithLinkedIn:(id)sender {
30 | [self.client getAuthorizationCode:^(NSString *code) {
31 | [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
32 | NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
33 | [self requestMeWithToken:accessToken];
34 | } failure:^(NSError *error) {
35 | NSLog(@"Quering accessToken failed %@", error);
36 | }];
37 | } cancel:^{
38 | NSLog(@"Authorization was cancelled by user");
39 | } failure:^(NSError *error) {
40 | NSLog(@"Authorization failed %@", error);
41 | }];
42 | }
43 |
44 |
45 | - (void)requestMeWithToken:(NSString *)accessToken {
46 | [self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
47 | NSLog(@"current user %@", result);
48 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
49 | NSLog(@"failed to fetch current user %@", error);
50 | }];
51 | }
52 |
53 | - (LIALinkedInHttpClient *)client {
54 | LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.ancientprogramming.com/liaexample"
55 | clientId:LINKEDIN_CLIENT_ID
56 | clientSecret:LINKEDIN_CLIENT_SECRET
57 | state:@"DCEEFWF45453sdffef424"
58 | grantedAccess:@[@"r_fullprofile", @"r_network"]];
59 | return [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // IOSLinkedInAPI-Podexample
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "LIAAppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LIAAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-PodexampleTests/IOSLinkedInAPI-PodexampleTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.eybenconsult.linkedin.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-PodexampleTests/IOSLinkedInAPI_PodexampleTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // IOSLinkedInAPI_PodexampleTests.m
3 | // IOSLinkedInAPI-PodexampleTests
4 | //
5 | // Created by Jacob von Eyben on 16/12/13.
6 | // Copyright (c) 2013 Eyben Consult ApS. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IOSLinkedInAPI_PodexampleTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation IOSLinkedInAPI_PodexampleTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-PodexampleTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, "6.1"
2 |
3 | pod 'IOSLinkedInAPI', :git => 'https://github.com/jeyben/IOSLinkedInAPI', :commit => '7b777b16867c713ed660c1d3711f83b76388ea99'
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (2.1.0):
3 | - AFNetworking/NSURLConnection
4 | - AFNetworking/NSURLSession
5 | - AFNetworking/Reachability
6 | - AFNetworking/Security
7 | - AFNetworking/Serialization
8 | - AFNetworking/UIKit
9 | - AFNetworking/NSURLConnection (2.1.0):
10 | - AFNetworking/Reachability
11 | - AFNetworking/Security
12 | - AFNetworking/Serialization
13 | - AFNetworking/NSURLSession (2.1.0):
14 | - AFNetworking/NSURLConnection
15 | - AFNetworking/Reachability (2.1.0)
16 | - AFNetworking/Security (2.1.0)
17 | - AFNetworking/Serialization (2.1.0)
18 | - AFNetworking/UIKit (2.1.0):
19 | - AFNetworking/NSURLConnection
20 | - IOSLinkedInAPI (2.0.0):
21 | - AFNetworking (>= 2.0.0)
22 |
23 | DEPENDENCIES:
24 | - IOSLinkedInAPI (from `https://github.com/jeyben/IOSLinkedInAPI`, commit `7b777b16867c713ed660c1d3711f83b76388ea99`)
25 |
26 | EXTERNAL SOURCES:
27 | IOSLinkedInAPI:
28 | :commit: 7b777b16867c713ed660c1d3711f83b76388ea99
29 | :git: https://github.com/jeyben/IOSLinkedInAPI
30 |
31 | SPEC CHECKSUMS:
32 | AFNetworking: c7d7901a83f631414c7eda1737261f696101a5cd
33 | IOSLinkedInAPI: 1c1b1bc3fcf21607225d2b9cd704bffab0abfbe1
34 |
35 | COCOAPODS: 0.27.1
36 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'IOSLinkedInAPI'
3 | s.version = '2.0.0'
4 | s.license = 'MIT'
5 | s.summary = 'IOS LinkedIn API capable of accessing LinkedIn using oauth2. Using a UIWebView to fetch the authorization code.'
6 | s.homepage = 'https://github.com/jeyben/IOSLinkedInAPI'
7 | s.authors = { 'Jacob von Eyben' => 'jacobvoneyben@gmail.com', 'Eduardo Fonseca' => 'hello@eduardo-fonseca.com' }
8 | s.source = { :git => 'https://github.com/jeyben/IOSLinkedInAPI.git', :tag => '2.0.0' }
9 | s.source_files = 'IOSLinkedInAPI'
10 | s.requires_arc = true
11 |
12 | s.platform = :ios, '6.0'
13 |
14 | s.dependency 'AFNetworking', '>= 2.0.0'
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInApplication.h:
--------------------------------------------------------------------------------
1 | // LIALinkedInApplication.h
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 |
24 | #import
25 |
26 | /**
27 | * A LIALinkedInApplication defines the application which is granted access to the users linkedin data.
28 | **/
29 | @interface LIALinkedInApplication : NSObject
30 |
31 | /** ************************************************************************************************ **
32 | * @name Initializers
33 | ** ************************************************************************************************ **/
34 |
35 | /**
36 | * The default initializer.
37 | * @param redirectURL Has to be a http or https url (required by LinkedIn), but other than that, the endpoint doesn't have to respond anything. The library only uses the endpoint to know when to intercept calls in the UIWebView.
38 | * @param clientId The id which is provided by LinkedIn upon registering an application.
39 | * @param clientSecret The secret which is provided by LinkedIn upon registering an application.
40 | * @param state The state used to prevent Cross Site Request Forgery. Should be something that is hard to guess.
41 | * @param grantedAccess An array telling which access the application would like to be granted by the enduser. See full list here: http://developer.linkedin.com/documents/authentication.
42 | * @return An initialized instance.
43 | **/
44 | - (id)initWithRedirectURL:(NSString *)redirectURL clientId:(NSString *)clientId clientSecret:(NSString *)clientSecret state:(NSString *)state grantedAccess:(NSArray *)grantedAccess;
45 |
46 | /**
47 | * The default static initializer.
48 | * @param redirectURL Has to be a http or https url (required by LinkedIn), but other than that, the endpoint doesn't have to respond anything. The library only uses the endpoint to know when to intercept calls in the UIWebView.
49 | * @param clientId The id which is provided by LinkedIn upon registering an application.
50 | * @param clientSecret The secret which is provided by LinkedIn upon registering an application.
51 | * @param state The state used to prevent Cross Site Request Forgery. Should be something that is hard to guess.
52 | * @param grantedAccess An array telling which access the application would like to be granted by the enduser. See full list here: http://developer.linkedin.com/documents/authentication.
53 | * @return An initialized instance.
54 | **/
55 | + (id)applicationWithRedirectURL:(NSString *)redirectURL clientId:(NSString *)clientId clientSecret:(NSString *)clientSecret state:(NSString *)state grantedAccess:(NSArray *)grantedAccess;
56 |
57 | /** ************************************************************************************************ **
58 | * @name Attributes
59 | ** ************************************************************************************************ **/
60 |
61 | /**
62 | * Has to be a http or https url (required by LinkedIn), but other than that, the endpoint doesn't have to respond anything. The library only uses the endpoint to know when to intercept calls in the UIWebView.
63 | **/
64 | @property(nonatomic, copy) NSString *redirectURL;
65 |
66 | /**
67 | * The id which is provided by LinkedIn upon registering an application.
68 | **/
69 | @property(nonatomic, copy) NSString *clientId;
70 |
71 | /**
72 | * The secret which is provided by LinkedIn upon registering an application.
73 | **/
74 | @property(nonatomic, copy) NSString *clientSecret;
75 |
76 | /**
77 | * The state used to prevent Cross Site Request Forgery. Should be something that is hard to guess.
78 | **/
79 | @property(nonatomic, copy) NSString *state;
80 |
81 | /**
82 | * An array telling which access the application would like to be granted by the enduser. See full list here: http://developer.linkedin.com/documents/authentication.
83 | **/
84 | @property(nonatomic, strong) NSArray *grantedAccess;
85 |
86 | /** ************************************************************************************************ **
87 | * @name Methods
88 | ** ************************************************************************************************ **/
89 |
90 | /**
91 | * Returns a string composed of the `grantedAccess` parameters.
92 | * @return All granted access parameters in a string.
93 | **/
94 | - (NSString *)grantedAccessString;
95 |
96 | @end
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInApplication.m:
--------------------------------------------------------------------------------
1 | // LIALinkedInApplication.m
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 |
24 | #import "LIALinkedInApplication.h"
25 |
26 |
27 | @implementation LIALinkedInApplication
28 |
29 | - (id)initWithRedirectURL:(NSString *)redirectURL clientId:(NSString *)clientId clientSecret:(NSString *)clientSecret state:(NSString *)state grantedAccess:(NSArray *)grantedAccess {
30 | self = [super init];
31 | if (self) {
32 | self.redirectURL = redirectURL;
33 | self.clientId = clientId;
34 | self.clientSecret = clientSecret;
35 | self.state = state;
36 | self.grantedAccess = grantedAccess;
37 | }
38 |
39 | return self;
40 | }
41 |
42 | + (id)applicationWithRedirectURL:(NSString *)redirectURL clientId:(NSString *)clientId clientSecret:(NSString *)clientSecret state:(NSString *)state grantedAccess:(NSArray *)grantedAccess {
43 | return [[self alloc] initWithRedirectURL:redirectURL clientId:clientId clientSecret:clientSecret state:state grantedAccess:grantedAccess];
44 | }
45 |
46 | - (NSString *)grantedAccessString {
47 | return [self.grantedAccess componentsJoinedByString: @"%20"];
48 | }
49 |
50 | @end
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInAuthorizationViewController.h:
--------------------------------------------------------------------------------
1 | // LIALinkedInAuthorizationViewController.h
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | #import
23 | #import "LIALinkedInApplication.h"
24 |
25 | typedef void(^LIAAuthorizationCodeSuccessCallback)(NSString *code);
26 | typedef void(^LIAAuthorizationCodeCancelCallback)(void);
27 | typedef void(^LIAAuthorizationCodeFailureCallback)(NSError *errorReason);
28 |
29 | /**
30 | * View Controller subclass containing a `UIWebView` which will be used to display the LinkedIN web UI to perform the login.
31 | **/
32 | @interface LIALinkedInAuthorizationViewController : UIViewController
33 |
34 | /** ************************************************************************************************ **
35 | * @name Initializers
36 | ** ************************************************************************************************ **/
37 |
38 | /**
39 | * Default initializer.
40 | * @param application A `LIALinkedInApplication` configured instance.
41 | * @param success A success block.
42 | * @param cancel A cancel block.
43 | * @param failure A failure block.
44 | * @returns An initialized instance
45 | **/
46 | - (id)initWithApplication:(LIALinkedInApplication *)application
47 | success:(LIAAuthorizationCodeSuccessCallback)success
48 | cancel:(LIAAuthorizationCodeCancelCallback)cancel
49 | failure:(LIAAuthorizationCodeFailureCallback)failure;
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInAuthorizationViewController.m:
--------------------------------------------------------------------------------
1 | // LIALinkedInAuthorizationViewController.m
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | #import "LIALinkedInAuthorizationViewController.h"
23 | #import "NSString+LIAEncode.h"
24 |
25 | #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
26 |
27 | NSString *kLinkedInErrorDomain = @"LIALinkedInERROR";
28 | NSString *kLinkedInDeniedByUser = @"the+user+denied+your+request";
29 |
30 | @interface LIALinkedInAuthorizationViewController ()
31 | @property(nonatomic, strong) UIWebView *authenticationWebView;
32 | @property(nonatomic, copy) LIAAuthorizationCodeFailureCallback failureCallback;
33 | @property(nonatomic, copy) LIAAuthorizationCodeSuccessCallback successCallback;
34 | @property(nonatomic, copy) LIAAuthorizationCodeCancelCallback cancelCallback;
35 | @property(nonatomic, strong) LIALinkedInApplication *application;
36 | @end
37 |
38 | @interface LIALinkedInAuthorizationViewController (UIWebViewDelegate)
39 |
40 | @end
41 |
42 | @implementation LIALinkedInAuthorizationViewController
43 |
44 | BOOL handlingRedirectURL;
45 |
46 | - (id)initWithApplication:(LIALinkedInApplication *)application success:(LIAAuthorizationCodeSuccessCallback)success cancel:(LIAAuthorizationCodeCancelCallback)cancel failure:(LIAAuthorizationCodeFailureCallback)failure {
47 | self = [super init];
48 | if (self) {
49 | self.application = application;
50 | self.successCallback = success;
51 | self.cancelCallback = cancel;
52 | self.failureCallback = failure;
53 | }
54 | return self;
55 | }
56 |
57 | - (void)viewDidLoad {
58 | [super viewDidLoad];
59 |
60 | if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7")) {
61 |
62 | self.edgesForExtendedLayout = UIRectEdgeNone;
63 | }
64 |
65 | UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(tappedCancelButton:)];
66 | self.navigationItem.leftBarButtonItem = cancelButton;
67 |
68 | self.authenticationWebView = [[UIWebView alloc] init];
69 | self.authenticationWebView.delegate = self;
70 | self.authenticationWebView.scalesPageToFit = YES;
71 | [self.view addSubview:self.authenticationWebView];
72 | }
73 |
74 | - (void)viewDidAppear:(BOOL)animated {
75 | [super viewDidAppear:animated];
76 | NSString *linkedIn = [NSString stringWithFormat:@"https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=%@&scope=%@&state=%@&redirect_uri=%@", self.application.clientId, self.application.grantedAccessString, self.application.state, [self.application.redirectURL LIAEncode]];
77 | [self.authenticationWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:linkedIn]]];
78 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
79 | }
80 |
81 | - (void)viewWillLayoutSubviews {
82 | [super viewWillLayoutSubviews];
83 | self.authenticationWebView.frame = self.view.bounds;
84 | }
85 |
86 |
87 | #pragma mark UI Action Methods
88 |
89 | - (void)tappedCancelButton:(id)sender {
90 | self.cancelCallback();
91 | }
92 |
93 | @end
94 |
95 | @implementation LIALinkedInAuthorizationViewController (UIWebViewDelegate)
96 |
97 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
98 | NSURL *requestURL = [request URL];
99 | NSString *url = [requestURL absoluteString];
100 |
101 | //prevent loading URL if it is the redirectURL
102 | handlingRedirectURL = [url hasPrefix:self.application.redirectURL];
103 |
104 | if (handlingRedirectURL) {
105 | if ([url rangeOfString:@"error"].location != NSNotFound) {
106 | BOOL accessDenied = [url rangeOfString:kLinkedInDeniedByUser].location != NSNotFound;
107 | if (accessDenied) {
108 | self.cancelCallback();
109 | } else {
110 | NSString* errorDescription = [self extractGetParameter:@"error_description" fromURL:requestURL];
111 | NSError *error = [[NSError alloc] initWithDomain:kLinkedInErrorDomain
112 | code:1
113 | userInfo:@{
114 | NSLocalizedDescriptionKey: errorDescription}];
115 | self.failureCallback(error);
116 | }
117 | } else {
118 | NSString *receivedState = [self extractGetParameter:@"state" fromURL: requestURL];
119 | //assert that the state is as we expected it to be
120 | if ([receivedState isEqualToString:self.application.state]) {
121 | //extract the code from the url
122 | NSString *authorizationCode = [self extractGetParameter:@"code" fromURL: requestURL];
123 | self.successCallback(authorizationCode);
124 | } else {
125 | NSError *error = [[NSError alloc] initWithDomain:kLinkedInErrorDomain code:2 userInfo:[[NSMutableDictionary alloc] init]];
126 | self.failureCallback(error);
127 | }
128 | }
129 | }
130 | return !handlingRedirectURL;
131 | }
132 |
133 | - (NSString *)extractGetParameter: (NSString *) parameterName fromURL:(NSURL *)url {
134 | NSMutableDictionary *mdQueryStrings = [[NSMutableDictionary alloc] init];
135 | NSString *urlString = url.query;
136 | for (NSString *qs in [urlString componentsSeparatedByString:@"&"]) {
137 | [mdQueryStrings setValue:[[[[qs componentsSeparatedByString:@"="] objectAtIndex:1]
138 | stringByReplacingOccurrencesOfString:@"+" withString:@" "]
139 | stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
140 | forKey:[[qs componentsSeparatedByString:@"="] objectAtIndex:0]];
141 | }
142 | return [mdQueryStrings objectForKey:parameterName];
143 | }
144 |
145 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
146 |
147 | // Turn off network activity indicator upon failure to load web view
148 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
149 |
150 | if (!handlingRedirectURL)
151 | self.failureCallback(error);
152 | }
153 |
154 | - (void)webViewDidFinishLoad:(UIWebView *)webView {
155 |
156 | // Turn off network activity indicator upon finishing web view load
157 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
158 |
159 | /*fix for the LinkedIn Auth window - it doesn't scale right when placed into
160 | a webview inside of a form sheet modal. If we transform the HTML of the page
161 | a bit, and fix the viewport to 540px (the width of the form sheet), the problem
162 | is solved.
163 | */
164 | if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
165 | NSString* js =
166 | @"var meta = document.createElement('meta'); "
167 | @"meta.setAttribute( 'name', 'viewport' ); "
168 | @"meta.setAttribute( 'content', 'width = 540px, initial-scale = 1.0, user-scalable = yes' ); "
169 | @"document.getElementsByTagName('head')[0].appendChild(meta)";
170 |
171 | [webView stringByEvaluatingJavaScriptFromString: js];
172 | }
173 | }
174 |
175 | @end
176 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInHttpClient.h:
--------------------------------------------------------------------------------
1 | // LIALinkedInHttpClient.h
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | /**
24 | * Check if before AFNetworking 3.0
25 | */
26 | #if __has_include_next("AFNetworking/AFHTTPRequestOperationManager.h")
27 |
28 | #import
29 | #define AFHTTPManager AFHTTPRequestOperationManager
30 |
31 | #elif __has_include_next("AFNetworking/AFHTTPSessionManager.h")
32 |
33 | #import
34 | #define AFHTTPManager AFHTTPSessionManager
35 | #define isSessionManager 1
36 |
37 | #endif
38 |
39 | @class LIALinkedInApplication;
40 |
41 | /**
42 | * A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
43 | **/
44 | @interface LIALinkedInHttpClient : AFHTTPManager
45 |
46 | /** ************************************************************************************************ **
47 | * @name Initializers
48 | ** ************************************************************************************************ **/
49 |
50 | /**
51 | * A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
52 | * @param application A `LIALinkedInApplication` configured instance.
53 | * @discussion This method calls `+clientForApplication:presentingViewController:` with presenting view controller as nil.
54 | **/
55 | + (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application;
56 |
57 | /**
58 | * A LinkedIn client is created using a `LIALinkedInApplication` and is the network instance that will perform all requests to the LinkedIn API.
59 | * @param application A `LIALinkedInApplication` configured instance.
60 | * @param viewController The view controller that the UIWebView will be modally presented from. Passing nil assumes the root view controller.
61 | **/
62 | + (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application presentingViewController:viewController;
63 |
64 | /** ************************************************************************************************ **
65 | * @name Methods
66 | ** ************************************************************************************************ **/
67 |
68 | /**
69 | * Returns YES if the current cached token is valid and not expired, NO otherwise.
70 | * @return The validity of the cached token.
71 | * @discussion When getting the token via the method `-getAccessToken:success:failure:`, the library is caching the token for further use.
72 | **/
73 | - (BOOL)validToken;
74 |
75 | /**
76 | * Returns the previsouldy cached LinkedIn access token.
77 | * @return The access token.
78 | * @discussion When getting the token via the method `-getAccessToken:success:failure:`, the library is caching the token for further use.
79 | **/
80 | - (NSString *)accessToken;
81 |
82 | /**
83 | * Retrieves the access token from a valid authhorization code.
84 | * @param authorizationCode The authorization code.
85 | * @param success A success block. The success block contains a dictoinary containing the access token keyed by the string "access_token".
86 | * @param failure A failure block containing the error.
87 | **/
88 | - (void)getAccessToken:(NSString *)authorizationCode success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure;
89 |
90 | /**
91 | * Retrieves an authorization code.
92 | * @param success A success block.
93 | * @param cancel A cancel block. This block is called when the user cancels the linkedin authentication flow.
94 | * @param failure A failure block containing the error.
95 | **/
96 | - (void)getAuthorizationCode:(void (^)(NSString *))success cancel:(void (^)(void))cancel failure:(void (^)(NSError *))failure;
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/LIALinkedInHttpClient.m:
--------------------------------------------------------------------------------
1 | // LIALinkedInHttpClient.m
2 | //
3 | // Copyright (c) 2013 Ancientprogramming
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | #import "LIALinkedInHttpClient.h"
23 | #import "LIALinkedInAuthorizationViewController.h"
24 | #import "NSString+LIAEncode.h"
25 |
26 | #define LINKEDIN_TOKEN_KEY @"linkedin_token"
27 | #define LINKEDIN_EXPIRATION_KEY @"linkedin_expiration"
28 | #define LINKEDIN_CREATION_KEY @"linkedin_token_created_at"
29 |
30 | @interface LIALinkedInHttpClient ()
31 | @property(nonatomic, strong) LIALinkedInApplication *application;
32 | @property(nonatomic, weak) UIViewController *presentingViewController;
33 | @end
34 |
35 | @implementation LIALinkedInHttpClient
36 |
37 | + (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application {
38 | return [self clientForApplication:application presentingViewController:nil];
39 | }
40 |
41 | + (LIALinkedInHttpClient *)clientForApplication:(LIALinkedInApplication *)application presentingViewController:viewController {
42 | LIALinkedInHttpClient *client = [[self alloc] initWithBaseURL:[NSURL URLWithString:@"https://www.linkedin.com"]];
43 | client.application = application;
44 | client.presentingViewController = viewController;
45 | return client;
46 | }
47 |
48 |
49 | - (id)initWithBaseURL:(NSURL *)url {
50 | self = [super initWithBaseURL:url];
51 | if (self) {
52 | [self setResponseSerializer:[AFJSONResponseSerializer serializer]];
53 | }
54 | return self;
55 | }
56 |
57 | - (BOOL)validToken {
58 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
59 |
60 | if ([[NSDate date] timeIntervalSince1970] >= ([userDefaults doubleForKey:LINKEDIN_CREATION_KEY] + [userDefaults doubleForKey:LINKEDIN_EXPIRATION_KEY])) {
61 | return NO;
62 | }
63 | else {
64 | return YES;
65 | }
66 | }
67 |
68 | - (NSString *)accessToken {
69 | return [[NSUserDefaults standardUserDefaults] objectForKey:LINKEDIN_TOKEN_KEY];
70 | }
71 |
72 | - (void)getAccessToken:(NSString *)authorizationCode success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure {
73 | NSString *accessTokenUrl = @"/uas/oauth2/accessToken?grant_type=authorization_code&code=%@&redirect_uri=%@&client_id=%@&client_secret=%@";
74 | NSString *url = [NSString stringWithFormat:accessTokenUrl, authorizationCode, [self.application.redirectURL LIAEncode], self.application.clientId, self.application.clientSecret];
75 |
76 | #ifdef isSessionManager // check if should use AFHTTPSessionManager or AFHTTPRequestOperationManager
77 | [self POST:url parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
78 |
79 | [self storeCredentials:responseObject];
80 | success(responseObject);
81 |
82 | } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
83 | failure(error);
84 | }];
85 | #else
86 | [self POST:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
87 |
88 | [self storeCredentials:responseObject];
89 | success(responseObject);
90 |
91 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
92 | failure(error);
93 | }];
94 | #endif
95 |
96 | }
97 |
98 | - (void)storeCredentials:(id _Nullable)responseObject {
99 | NSString *accessToken = [responseObject objectForKey:@"access_token"];
100 | NSTimeInterval expiration = [[responseObject objectForKey:@"expires_in"] doubleValue];
101 |
102 | // store credentials
103 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
104 |
105 | [userDefaults setObject:accessToken forKey:LINKEDIN_TOKEN_KEY];
106 | [userDefaults setDouble:expiration forKey:LINKEDIN_EXPIRATION_KEY];
107 | [userDefaults setDouble:[[NSDate date] timeIntervalSince1970] forKey:LINKEDIN_CREATION_KEY];
108 | [userDefaults synchronize];
109 | }
110 |
111 | - (void)getAuthorizationCode:(void (^)(NSString *))success cancel:(void (^)(void))cancel failure:(void (^)(NSError *))failure {
112 | LIALinkedInAuthorizationViewController *authorizationViewController = [[LIALinkedInAuthorizationViewController alloc]
113 | initWithApplication:
114 | self.application
115 | success:^(NSString *code) {
116 | [self hideAuthenticateView];
117 | if (success) {
118 | success(code);
119 | }
120 | }
121 | cancel:^{
122 | [self hideAuthenticateView];
123 | if (cancel) {
124 | cancel();
125 | }
126 | } failure:^(NSError *error) {
127 | [self hideAuthenticateView];
128 | if (failure) {
129 | failure(error);
130 | }
131 | }];
132 | [self showAuthorizationView:authorizationViewController];
133 | }
134 |
135 | - (void)showAuthorizationView:(LIALinkedInAuthorizationViewController *)authorizationViewController {
136 | if (self.presentingViewController == nil)
137 | self.presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
138 |
139 | UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:authorizationViewController];
140 |
141 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
142 | nc.modalPresentationStyle = UIModalPresentationFormSheet;
143 | }
144 |
145 | [self.presentingViewController presentViewController:nc animated:YES completion:nil];
146 | }
147 |
148 | - (void)hideAuthenticateView {
149 | [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
150 | }
151 |
152 |
153 | @end
154 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/NSString+LIAEncode.h:
--------------------------------------------------------------------------------
1 | // NSString+LIAEncode.h
2 | //
3 | // Copyright (c) 2013 StocksCompare
4 | // Created by Eugene on 04/06/2013.
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | #import
26 |
27 | /**
28 | * NSString additions for the LIALinkedIn framework.
29 | **/
30 | @interface NSString (LIAEncode)
31 |
32 | /** ************************************************************************************************ **
33 | * @name Encoding
34 | ** ************************************************************************************************ **/
35 |
36 | /**
37 | * String encoding.
38 | * @return An encoded string.
39 | **/
40 | - (NSString *)LIAEncode;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/NSString+LIAEncode.m:
--------------------------------------------------------------------------------
1 | // NSString+LIAEncode.m
2 | //
3 | // Copyright (c) 2013 StocksCompare
4 | // Created by Eugene on 04/06/2013.
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | #import "NSString+LIAEncode.h"
26 |
27 | @implementation NSString (LIAEncode)
28 |
29 | -(NSString *) LIAEncode {
30 | return (NSString *)CFBridgingRelease(
31 | CFURLCreateStringByAddingPercentEscapes(
32 | NULL,
33 | (__bridge CFStringRef) self,
34 | NULL,
35 | CFSTR("!*'();:@&=+$,/?%#[]"),
36 | kCFStringEncodingUTF8
37 | )
38 | );
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/IOSLinkedInAPI/Resources/01-refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/IOSLinkedInAPI/Resources/01-refresh.png
--------------------------------------------------------------------------------
/IOSLinkedInAPI/Resources/01-refresh@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/IOSLinkedInAPI/Resources/01-refresh@2x.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Ancientprogramming (http://www.ancientprogramming.com/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | IOSLinkedInAPI
2 | ==============
3 |
4 | *Note:* As of the 12´ May 2015 LinkedIn applied restrictions to API usage for all non partners:
5 | See: https://developer.linkedin.com/blog/posts/2015/developer-program-changes
6 |
7 | ----------------------------------------------------------
8 | A small non intrusive library that makes it easy to authenticate and authorize against LinkedIn using OAuth2.
9 | The API uses a UIWebView to authenticate against LinkedIn.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | If the enduser is authenticated you end up with an accesstoken that is nessesary to retrieve data from the LinkedIn [API](https://developer.linkedin.com/apis)
19 |
20 | Why this library?
21 | -----------------
22 | Why yet another LinkedIn library?
23 | Although there already exists a couple of iOS libraries which is wrapping the LinkedIn API, none of them *(at least to my knowledge)* is using OAuth2 which is the preferred protocol according to LinkedIn.
24 |
25 | How To Get Started
26 | ------------------
27 | The library can be fetched as a Pod from [cocoapods](http://cocoapods.org/?q=ioslinkedinapi)
28 |
29 | If you aren't using CocoaPods you can always download the libary and import the files from the folder IOSLinkedInAPI into your existing project.
30 |
31 | Example Code
32 | ------------
33 |
34 | A LinkedIn client is created using a LIALinkedInApplication.
35 | A LIALinkedInApplication defines the application which is granted access to the users linkedin data.
36 | ``` objective-c
37 | LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.ancientprogramming.com/liaexample"
38 | clientId:@"clientId"
39 | clientSecret:@"clientSecret"
40 | state:@"DCEEFWF45453sdffef424"
41 | grantedAccess:@[@"r_fullprofile", @"r_network"]];
42 | return [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
43 | ```
44 | * redirectURL: has to be a http or https url (required by LinkedIn), but other than that, the endpoint doesn't have to respond anything. The library only uses the endpoint to know when to intercept calls in the UIWebView.
45 | * clientId: The id which is provided by LinkedIn upon registering an application.
46 | * clientSecret: The secret which is provided by LinkedIn upon registering an application.
47 | * state: the state used to prevent Cross Site Request Forgery. Should be something that is hard to guess.
48 | * grantedAccess: An array telling which access the application would like to be granted by the enduser. See full list here: http://developer.linkedin.com/documents/authentication
49 | * presentingViewController: The view controller that the UIWebView will be modally presented from. Passing nil assumes the root view controller.
50 |
51 | Afterwards the client can be used to retrieve an accesstoken and access the data using the LinkedIn API:
52 | ``` objective-c
53 | - (IBAction)didTapConnectWithLinkedIn:(id)sender {
54 | [self.client getAuthorizationCode:^(NSString *code) {
55 | [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
56 | NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
57 | [self requestMeWithToken:accessToken];
58 | } failure:^(NSError *error) {
59 | NSLog(@"Quering accessToken failed %@", error);
60 | }];
61 | } cancel:^{
62 | NSLog(@"Authorization was cancelled by user");
63 | } failure:^(NSError *error) {
64 | NSLog(@"Authorization failed %@", error);
65 | }];
66 | }
67 |
68 | - (void)requestMeWithToken:(NSString *)accessToken {
69 | [self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
70 | NSLog(@"current user %@", result);
71 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
72 | NSLog(@"failed to fetch current user %@", error);
73 | }];
74 | }
75 | ```
76 | The code example retrieves an access token and uses it to get userdata for the user which granted the access.
77 | The cancel callback is executed in case the user actively declines the authorization by pressing cancel button in the UIWebView (see illustration above).
78 | The failure callbacks is executed in case either the of the steps fails for some reason.
79 |
80 | Example App
81 | ------------
82 | A small example application can be found here:
83 | https://github.com/jeyben/IOSLinkedInAPI/tree/master/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample
84 |
85 | It uses the cocoapods.
86 | Just run 'pods install' in the directory after your clone and you should be able to run the app afterwards
87 |
88 |
89 | Next step
90 | --------------------
91 | The library is currently handling the authentication and authorization.
92 | I would like to improve the libary to also make it easy to do the actually API calls.
93 | My current thought is to let the client remember the accessToken after it is retrieved and afterwards automatically append it to futher calls along with the format=json GET parameter.
94 |
95 | If you have ideas of how that could be implemented let me know.
96 |
97 | http://www.ancientprogramming.com
98 |
--------------------------------------------------------------------------------
/gh-pages/authenticate-example-ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/gh-pages/authenticate-example-ipad.png
--------------------------------------------------------------------------------
/gh-pages/authenticate-example-iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/gh-pages/authenticate-example-iphone.png
--------------------------------------------------------------------------------
/gh-pages/authenticate-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeyben/IOSLinkedInAPI/7b37caa1d42cccb5757d142b6f0b0b272671afbf/gh-pages/authenticate-example.png
--------------------------------------------------------------------------------