Giter Site home page Giter Site logo

ioslinkedinapi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ioslinkedinapi's Issues

Is there a way to access profile picture, connections etc details using this library ?

Hello Jeyben,

First of all, I am sorry for creating this as an issue. I don't know where to ask you a question.

I can't figure out how to access user profile picture using your API. I got the profile picture URL when I logged in, but, I am unable to get the image from URL.

And also, how to get other details of user like user connections, etc using your API.

Could you help me please ? I am using this for a big project and I just want to use only OAuth2 which is used in only your API.

Let me know if you need any more detailed information from me to answer.

Thanks,
Sai Jithendra.

Strange AFNetworking call

Why do you call #import <AFNetworking/AFHTTPRequestOperationManager.h> on LIALinkedInHttpClient.h even though AFNetworking is not a binary framework?

Getting error Domain=NSURLErrorDomain Code=-1015 "cannot decode raw data"

Hi Jeyben
Thanks for this code and for the patience.
I downloaded the example code and trying to make it work but I get
"Authorization failed Error Domain=NSURLErrorDomain Code=-1015 "cannot decode raw data" UserInfo=0x17d7ce00,,,,,," after "didTapConnectWithLinkedIn" is called.
Can yo please advice?
thanks a lot
Gilad

CocoaPods issue when also including RestKit

I ran into this issue when trying to use your pod while also using RestKit:

[!] IOSLinkedInAPI (0.0.4) tries to activate AFNetworking (~> 1.2.1)', but already activated version1.3.1' by RestKit/Network (0.20.2).

Suggestions?

Login Error

Hi All,

I have some problems, I have created app in linkedIn site and have the redirect url, but I can't see web page for login, I have got error: Authorization failed Error Domain=LIALinkedInERROR Code=1 "The operation couldn’t be completed. (LIALinkedInERROR error 1.)"
Until May 12, the application works fine, after I started getting this error. Can YOU help me? Please

WebKit discarded an uncaught exception

After entering credentials and signing in, I'm getting the following error in both example projects and my own project.

IOSLinkedInAPI-Podexample[968:60b] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: *** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]

Can't manage to retrieve token

I am trying to use the library to retrieve the access token. I don't seem to manage though when using the code example provided.

I get an error message for the line self.client getPath. The getPath method is not recognised on LIALinkedInHttpClient class.

What am I missing?

Thanks

Analyze error in LIALinkedInAuthorizationViewController

I've just done analyze on my project in Xcode and get this warning:

LIALinkedInAuthorizationViewController.m:77:1: warning: The 'viewDidAppear:' instance method in UIViewController subclass 'LIALinkedInAuthorizationViewController' is missing a [super viewDidAppear:] call

It seems that you forgot to use super method. May be it's worth fixing?

Authorization failed LinkedIn1: Error Domain=LIALinkedInERROR Code=1 "The operation couldn’t be completed. (LIALinkedInERROR error 1.)"

Hi, I am getting the next error:

Authorization failed LinkedIn1: Error Domain=LIALinkedInERROR Code=1 "The operation couldn’t be completed. (LIALinkedInERROR error 1.)"

when I tap a custom build LinkedIn button.

Here is the code that I am using:

#pragma mark Linkedin integration
- (void)suggestionsPopupLinkedInButtonFunction{
    dispatch_async(dispatch_get_main_queue(), ^{
    [_client getAuthorizationCode:^(NSString *code) {
        [_client getAccessToken:code success:^(NSDictionary *accessTokenData) {
            NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
            [self requestMeWithToken:accessToken];
        }                   failure:^(NSError *error) {
            NSLog(@"Quering accessToken failed %@", error);
        }];
    }
                           cancel:^{
        NSLog(@"Authorization was cancelled by user");
    }
                          failure:^(NSError *error) {
        NSLog(@"Authorization failed LinkedIn1: %@", error);
    }];
    });
}

- (void)requestMeWithToken:(NSString *)accessToken {
    [_client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~:(skills)?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
        NSLog(@"current user %@", result);
        //process the received result and convert it to string
        NSString *skillFinalString = @"";

        for (int countValuesSize = 0; countValuesSize < [[[result objectForKey:@"skills"] objectForKey:@"values"] count]; countValuesSize++) {
            NSString *skillValueString = [[NSString alloc] initWithString:[[[[[result objectForKey:@"skills"] objectForKey:@"values"] objectAtIndex:countValuesSize] objectForKey:@"skill"] objectForKey:@"name"]];
            NSLog(@"skillValueString = %@", skillValueString);
            if (countValuesSize < [[[result objectForKey:@"skills"] objectForKey:@"values"] count] - 1) {

                skillFinalString = [NSString stringWithFormat:@"%@; ",[skillFinalString stringByAppendingString:skillValueString]];

            } else {
                skillFinalString = [skillFinalString stringByAppendingString:skillValueString];
            }

        }
        //send the skillFinalString data to class variable and send them to server when finish/ done button is pressed
        NSLog(@"%@", skillFinalString);
        LinkedInInfo = skillFinalString;
        NSLog(@"%@", skillFinalString);

        // Hide all social network Ui ellements from suggestion page
        [self hideAllSocialPopupElements];

        //save the newlly retrived data to logedinUservCard
        [logedinUservCard setObject:LinkedInInfo atIndexedSubscript:9];
        [logedinUservCard setObject:[NSString stringWithFormat:@""] atIndexedSubscript:1];
        [self updatevCard];

    }        failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"failed to fetch current user %@", error);
    }];
}

- (LIALinkedInHttpClient *)client {
    LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.newrosoft.com/"
                                                                                    clientId:@"77ibz6e8ed8i53"
                                                                                clientSecret:@"jkfPVSmEqGredwXO"
                                                                                       state:@"DCEEFWF45453sdffef424"
                                                                               grantedAccess:@[@"r_fullprofile", @"r_network"]];
    return [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
}

and also i declare:

LIALinkedInHttpClient *_client;

witch takes the value:

_client = [self client];

Also I have opened a stack overflow issue.

LIALinkedInClientExampleCredentials.h file

I'm new to programming and found this tutorial extremely helpful, but I can't get past creating this file. Can someone copy and paste the code for this file (excluding you client id and client keys of course).

permissions issue

Hi everybody...
When I add new permissions in
[LIALinkedInApplicationapplicationWithRedirectURL: clientId: clientSecret: state: grantedAccess:@"Permssion1", @"Permssion2", etc];
method I don't receive expected result.
I always receive
result like this {
firstName = fName;
headline = "iOS developer";
id = FI09uYt2w2;
lastName = lName;
siteStandardProfileRequest = {
url = "https://www.linkedin.com/profile/view?id=32442245&authType=name&authToken=Vze-&trk=api*a4353471*s4416641*";
};
}

"Authentication failure" when web view load aborted

webView:didFailLoadWithError: is called every time when webView:shouldStartLoadWithRequest:navigationType: returns NO, which happens when redirect should be aborted.

There should be some instance variable that shows that request was aborted on purpose rather than failed so that webView:didFailLoadWithError: doesn't call failureCallback in these situations.

fatal error: unexpectedly found nil while unwrapping an Optional value

I'm doing bridging header but it throw an error message

fatal error: unexpectedly found nil while unwrapping an Optional value

My code

@IBAction func btnLinkedin(sender: AnyObject) {
if btnLinkedin.on {
client.getAuthorizationCode({ (code:String!) -> Void in
println(code)
self.client.getAccessToken(code, success: { (accessTokenData) -> Void in
if let dict = accessTokenData as? Dictionary<String, AnyObject> {
let accessToken: AnyObject? = dict["access_token"]
self.requestMeWithToken(accessToken!)
}
}, failure: { (error:NSError!) -> Void in
println("Quering accessToken failed (error)")
})
}, cancel: { () -> Void in
println("Authorization was cancelled by user")
}, failure: { (error:NSError!) -> Void in
println("Authorization failed (error)")
})
println("Switch is on")
btnLinkedin.setOn(true, animated:true)
} else {
println("Switch is off")
btnLinkedin.setOn(false, animated:true)
}
}

func requestMeWithToken(accessToken: AnyObject){
    client.GET("https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", parameters: nil, success: { (operation:AFHTTPRequestOperation!, result:AnyObject!) -> Void in
        println("current user \(result)")
        }) { (operation: AFHTTPRequestOperation!, error:NSError!) -> Void in
        println("failed to fetch current user \(error)")
    }
}

Please advice.

Warning: Attempt to present <*> on <*> whose view is not in the window hierarchy

I try to login via Linkedin ios SDK but I got this error message

Warning: Attempt to present <UINavigationController: 0x15fd43cd0> on <XXXXX.ViewController: 0x15fd0d1f0> whose view is not in the window hierarchy!

My code

- (void)viewDidLoad {
    [super viewDidLoad];
    _client = [self client];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;


}

-(IBAction)linkedinSwitch:(id)sender{
    if(linkedinSwitch.on) {
        NSLog(@"linkedin on");
        [self didTapConnectWithLinkedIn];
    }
    else {
        NSLog(@"linkedin off");
    }
}

- (void)didTapConnectWithLinkedIn {
    [self.client getAuthorizationCode:^(NSString *code) {
        [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
            NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
            [self requestMeWithToken:accessToken];
        }                   failure:^(NSError *error) {
            NSLog(@"Quering accessToken failed %@", error);
        }];
    }                      cancel:^{
        NSLog(@"Authorization was cancelled by user");
    }                     failure:^(NSError *error) {
        NSLog(@"Authorization failed %@", error);
    }];
}

Even I put _client = [self client] in viewDidAppear, still same

- (void) viewWillAppear:(BOOL)animated {
    _client = [self client];

}

Please advice. Thank you.

not showing Login Window for LinkedIn API in iOS

Mr. Jeyben, thanks for sharing great api for integrating the LinkedIn Api to iOS apps. This saves my time for integarting to my app. Yesterday i downloaded this api and i got user info from LinkedIn. Today i opend my app, the login window not showing after clicking the button. Its very strange to me really, i checked my code perfectly, i dint changed anything. Could you pls give solution for this, Thanks in advanced.

Missing items in response object for r_basicprofile

Hey @jeyben,

First of all, thanks for the library; it really simplified things.

Now here's the issue I'm having: Authentication and everything is working fine. However, the dictionary (NSDictionary *result) that I'm getting back in the 'requestMeWithToken' method is only returning firstName, headline, id, lastName, and a siteStandardProfileRequest URL. I've set the grantedAccess array to include r_basicprofile and r_emailaddress. According to the LinkedIn developer docs, there are approximately 20 fields that I should be getting data for with r_basicprofile. Is there a reason I'm only getting these five? Do I need to make another call once I've established the connection with LinkedIn to get this other information? Any help would be great!

Authentication in other webviews?

This is a feature question...

Once the user authenticates using this library, I present them with another webview showing them their profile obtained from the LinkedIn API.

Specifically, the problem I'm having is displaying their "site-standard-profile-request" profile URL. This requires a login to be viewed, unlike public profiles. LinkedIn is asking the user is to login again in the second WebView, then everything works fine.

Are suggestions/plans as to authenticating that second WebView from the Oauth2 session? I've tried manually managing cookies from the session but no luck so far.

redirect url issue

Getting this issue everytime
Authorization failed Error Domain=LIALinkedInERROR Code=1 "The operation couldn’t be completed. (LIALinkedInERROR error 1.)

LIALinkedInERROR error 1.

Hello. Please help me solve this error.

Authorization failed Error Domain=LIALinkedInERROR Code=1 "The operation couldn’t be completed. (LIALinkedInERROR error 1.)

I get this error when I ask r_fullprofile access.

What should I do ? Is any way to fix this issue ?

Full profile

Hello all.

Can anyone help me with getting full profile from Linkedin?

I have these permissions.

screen shot 2015-08-13 at 10 40 51

Should I ask more permissions from Linkedin or not for that ?

And if I should where can I do it ?

unauthorized_client

HI !

Do you have any idea why every time the url accessToken returns "unauthorized_client" with a 401 code ?

This url is called in this method : getAccessToken:success:failure.
The permissions in my linkedIn Application are set correctly, as well as the API/Secret Key in the project sample.

I successfully get the authorization code with the login webview but the next url called right after it is the accessToken to retrieve the user token, and I get an error every time.

Here is the debug of the error:

Quering accessToken failed Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: unauthorized (401)" UserInfo=0x8d52b60 {NSErrorFailingURLKey=https://www.linkedin.com/uas/oauth2/accessToken, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x8ae8340> { URL: https://www.linkedin.com/uas/oauth2/accessToken } { status code: 401, headers {
"Cache-Control" = "no-cache, no-store";
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Language" = "en-US";
"Content-Length" = 85;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Tue, 18 Feb 2014 15:57:57 GMT";
Expires = "Thu, 01 Jan 1970 00:00:00 GMT";
Pragma = "no-cache";
Server = "Apache-Coyote/1.1";
"Set-Cookie" = "_lipt="delete me"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, _lipt=deleteMe; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; domain=.www.linkedin.com, lang="delete me"; Version=1; Domain=linkedin.com; Path=/; Expires=Thu, 01-Jan-1970 00:00:10 GMT, lang="v=2&lang=en-us"; Version=1; Domain=.linkedin.com; Path=/";
Vary = "Accept-Encoding";
"X-LI-UUID" = "zvpsOXLUEtfGhj+GCeH9tQ==";
"X-Li-Fabric" = "prod-lva1";
"X-Li-Pop" = "PROD-IDB2, PROD-IDB2";
} }, NSLocalizedDescription=Request failed: unauthorized (401)}

Don't hesitate to contact if you need some help or more information.

Warning window hierarchy

Just started using this API and I got this error in the console:

Warning: Attempt to present <UINavigationController: 0x14dd59e0> on <UINavigationController: 0x14d76820> whose view is not in the window hierarchy!

Any suggestions to fix it!

Revert podspec AFNetworking dependency

It looks like you updated the podspec for 1.0.0 a month ago so that the AFNetworking dependency is version 1.3.3. It used to be 1.2.1, which is what I've been using in my app. Since the pod version wasn't updated with this change, pod install fails for me unless I change my AFNetworking version to 1.3.3. However, when I do that, I run into other problems with your linkedin pod.

I think the pod version should have been updated to 1.0.1 when the AFNetworking dependency version changed. Oddly enough, your repo shows 1.2.2 as the dependency for version 1.0.0, but Cocoapods shows 1.3.3.

Here's the Cocoapods podspec for version 1.0.0: https://github.com/CocoaPods/Specs/blob/master/IOSLinkedInAPI/1.0.0/IOSLinkedInAPI.podspec

And here's your current one: https://github.com/jeyben/IOSLinkedInAPI/blob/1.0.0/IOSLinkedInAPI.podspec

With that being said, thanks for making a great LinkedIn library!

session cookie or others exist?

are there something session objects to remain login state like facebook session object?
or always require to login using linkedIn dialog?
how can i save login state or request library? are there exist check session IOSLinkedInAPI project?

Post request does nothing

[self.client POST:linkedinShareURL parameters:linkedinParams success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"SUCCESS: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"FAILURE: %@", error);
}];

The client is already authenticated with an access token inside the linkedinShareURL but it's as if it does nothing. No callbacks are fired.

Compatibility with AFNetworking 3.0

I have recently updated my AFNetworking to 3.0, and found out that IOSLinkedInAPI can no longer be compiled as it is dependent on AFNetworking 2.0.

May I know if there is any plan to add support for AFNetworking 3.0?

Create Better Login Window that works for iPhone and iPad

Howdy -
Thanks for putting this framework together. I rolled my own framework using OAuth1, and this looks like it has the potential to be far cleaner.

I created my own view controller nestled in a Navigation Controller for LinkedIn Auth that works on both iPad and iPhone. It would be a nice addition to this project so that the implementation is a true drop-in via CocoaPods with no further UI magic needed.

Would you be interested in me adding this functionality via a Pull Request?

Screenshot of my login window:
screen shot 2013-11-26 at 12 13 42 pm

Swift version for Xcode 6.1

Here is what I did for swift in case anyone needs it. Note, this is using the fork that allows AFNetworking 1.x since RestKit requires that still.

// MARK: LinkedIn
var linkedInClient: LIALinkedInHttpClient {
    let application = LIALinkedInApplication(redirectURL: "http://api.sessionradar.com/linkedin", clientId: kLinkedInClientId, clientSecret: kLinkedInClientSecret, state: kLinkedInState, grantedAccess: ["r_emailaddress"])
    return LIALinkedInHttpClient(forApplication: application, presentingViewController: self)
}

@IBAction func didTapConnectWithLinkedIn(sender: AnyObject) {
    self.linkedInClient.getAuthorizationCode({ (code: String!) -> Void in
        self.linkedInClient.getAccessToken(code, success: { (accessTokenData: [NSObject: AnyObject]!) -> Void in
            let accessToken = accessTokenData["access_token"] as String
            let urlPath = "https://api.linkedin.com/v1/people/~/email-address?oauth2_access_token=\(accessToken)&format=json"
            self.linkedInClient.getPath(urlPath, parameters: nil, success: { (operation: AFHTTPRequestOperation!, result: AnyObject!) -> Void in
                self.showActivityIndicator()
                let responseData = result as NSData!
                let userEmail = NSString(data: responseData, encoding: NSUTF8StringEncoding)
                // My Login code here that needs the LinkedIn Email
            }, failure: { (operation, error) -> Void in
                NSLog("error getting linked in data: \(error)")
            })
        }, failure: { (error) -> Void in
            NSLog("error getting linked in access token: \(error)")
        })
    }, cancel: { () -> Void in
        NSLog("LinkedIn authorization canceled")
    }) { (error) -> Void in
        NSLog("Error getting linkedin auth code: \(error)")
    }
}

Can't share post with the LinkedIn API

I have also registered the issue on stackoverflow: http://stackoverflow.com/questions/23758142/ioslinkedinapi-cant-share-post-with-the-linkedin-api
https://github.com/jeyben/IOSLinkedInAPI/issues/new

In this code I can't find proper example code but however I had written some code through which post can be shared. Here is my code:

In the code I have only single viewcontroller in which I have taken only two buttons, 1) Linked In Account [This button is used to present login controller and gets user successfully logged into the account] 2) Share [Allows user to share content on behalf of logged in user where the request fails]

ViewController.h

import <UIKit/UIKit.h>

import "LIALinkedInApplication.h"

import "LIALinkedInHttpClient.h"

@interface ViewController : UIViewController

@Property (nonatomic, strong) LIALinkedInHttpClient *client;

  • (IBAction) linkedInClicked:(id)sender;
  • (void)requestMeWithToken:(NSString *)accessToken;

@EnD

ViewController.m

import "ViewController.h"

@interface ViewController ()

@EnD

@implementation ViewController

  • (void)viewDidLoad
    {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.google.com" clientId:@"w57zqiw6cv73" clientSecret:@"Pj5MVxtkpbefau1v" state:@"something" grantedAccess:@[@"r_fullprofile", @"r_network", @"rw_nus"]];
    self.client = [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];

}

  • (IBAction) linkedInClicked:(id)sender { // Login into the account
    [self.client getAuthorizationCode:^(NSString *code) {
    [self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
    NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
    [self requestMeWithToken:accessToken];
    } failure:^(NSError *error) {
    NSLog(@"Quering accessToken failed %@", error);
    }];
    } cancel:^{
    NSLog(@"Authorization was cancelled by user");
    } failure:^(NSError *error) {
    NSLog(@"Authorization failed %@", error);
    }];
    }

  • (IBAction) postMessage :(id)sender { // Post via logged in account, so, first go login and then share content
    NSString *strURL = @"https://api.linkedin.com/v1/people/~/shares";

    NSMutableDictionary *contents=[[NSMutableDictionary alloc] init];
    [contents setValue:@"description goes here" forKey:@"description"];
    [contents setValue:@"www.google.com" forKey:@"submitted-url"];
    [contents setValue:@"title goes here" forKey:@"title"];

    NSMutableDictionary *visible=[[NSMutableDictionary alloc] init];
    [visible setValue:@"anyone" forKey:@"code"];

    NSMutableDictionary *updatedic=[[NSMutableDictionary alloc] init];

    [updatedic setObject:visible forKey:@"visibility"];
    [updatedic setObject:contents forKey:@"content"];
    [updatedic setValue:@"Check out the LinkedIn Share API!" forKey:@"comment"];
    //[updatedic setValue:@"json" forKey: @"x-li-format"];

    [self.client POST:strURL parameters:updatedic success:^(AFHTTPRequestOperation *operation, NSDictionary *dict) {
    NSLog(@"Successfully posted", nil);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Failed post", nil);
    }];
    }

  • (void)requestMeWithToken:(NSString *)accessToken {
    [self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
    NSLog(@"current user %@", result);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"failed to fetch current user %@", error);
    }];
    }

When I try to login the app, I get successful message but after that when I try to share any post as described in above code, I get failure and see what is console:

Printing description of error:
Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: unauthorized (401)" UserInfo=0x8a6d500 {NSErrorFailingURLKey=https://api.linkedin.com/v1/people/~/shares, NSLocalizedDescription=Request failed: unauthorized (401), NSUnderlyingError=0x8ab1bd0 "Request failed: unacceptable content-type: text/xml", AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x8a1f5f0> { URL: https://api.linkedin.com/v1/people/~/shares } { status code: 401, headers {
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "text/xml;charset=UTF-8";
Date = "Tue, 20 May 2014 09:38:01 GMT";
Server = "Apache-Coyote/1.1";
"Transfer-Encoding" = Identity;
Vary = "*";
"Www-Authenticate" = "OAuth realm="https://api.linkedin.com\"";
"X-LI-UUID" = "wUQ+CTiK5WDItDrWLbZJFQ==";
"X-Li-Fabric" = "PROD-ELA4";
"X-Li-Pop" = "PROD-ELA4";
"x-li-format" = xml;
"x-li-request-id" = 30K08X3IL7;
} }}

I have tried searching a lot on AFNetworking, LinkedIn authorization, Unauthorized access, etc. but could not found anything over this. Let me know if anyone of you are aware of something about this or suggest me any other option for LinkedIn iPhone SDK.

Add description to errors when something fails

Currently we only set a code without any readably description of why an error occured.

The same goes for the code - a description of the code in form of a static variable could be useful for the user of the library.

Invalid redirect_uri

Hi, and I would like to thank you for this library and the future help

I tried to implement this code in my project:

https://github.com/jeyben/IOSLinkedInAPI/tree/master/Example/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample/IOSLinkedInAPI-Podexample

and entered my own values, I don't get any errors, but when I tap the Linked in button,
instead of beeing redirected to the LinkedIn log in page I get the next error: "invalid redirect_uri. This value must match a URL registered with the API Key"

Use of undeclared type 'LIALinkedInHttpClient'

Since I updated my xcode to 6.3.1, I got this error message

/Users/MNurdin/Documents/iOS/xxxxx/Controllers/Profile/SettingBakTableViewController.swift:16:17: Use of undeclared type 'LIALinkedInHttpClient'

I initialize client variable like this

var client: LIALinkedInHttpClient!

It's impossible to import LIALinkedInHttpClient via swift since I already did bridging header. Please advice. Thank you.

Getting Error in Post Status request

Hi, it's really a good API.can you give me an example of post status request ? I am using your API and trying to post it by

NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:@"comment", @"TEST", nil];
NSString *url = [NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~/shares?oauth2_access_token=%@",accesToken];
[self postPath:url parameters:params success:^(AFHTTPRequestOperation *operation, NSDictionary *accessToken) {
NSLog(@"dictionary is :%@",accessToken);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error :%@",[error description]);
}];
where accesToken is what i get by NSString *accessToken = [accessTokenData objectForKey:@"access_token"];

but getting error :{NSLocalizedRecoverySuggestion={
"errorCode": 0,
"message": "Access to posting shares denied",
"requestId": "KP3O4JQCD5",
"status": 403,
"timestamp": 1379659659933
}

Access token request problems

  1. Library makes GET request, LinkedIn documentation requires POST request

  2. Redirect URLs in both authorisation and access token requests are not encoded

  3. The main problem - authorisation code received from LinkedIn is different from the one sent in access token request (the first character is missing).
    It happens because

    NSString *authorizationCode = [url substringWithRange:NSMakeRange([successPrefix length], [url length] - [successPrefix length] - [successSuffix length])];
    

in

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

of LIALinkedInAuthorizationViewController returns the wrong substring (and the method used to extract parameter from URL is not reliable, if any additional parameter is added to URL or their order is changed it can stop working).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.