iOS LinkedIn API error

后端 未结 5 663
心在旅途
心在旅途 2021-01-07 05:10

I am trying to implement this LinkedIn library in my project, but it seems that I get an error while I try to present the LinkedIn screen:

Authorizati

相关标签:
5条回答
  • 2021-01-07 05:27

    Jack's answer is absolutely true, Jack's Answer. In addition to this you can use this library also LinkedinIOSHelper , it is easy to use

    0 讨论(0)
  • 2021-01-07 05:35

    Since the 12th May Linkedin's API has changed. From now on any apps requesting r_contactinfo must be approved by LinkedIn. This link explains the changes.

    I'm using this Library and just had to change the permissions from @"r_contactinfo" to @"r_basicprofile", @"r_emailaddress".

    Also remember to change your app permissions on developer.linkedin.com to match the above.

    0 讨论(0)
  • 2021-01-07 05:44

    You should have to use:

    code=https://www.linkedin.com/oauth/v2/authorization?
    

    In place of:

    code=https://www.linkedin.com//uas/oauth2/authorization?
    

    Also in linkedin api:

    LIALinkedInAuthorizationViewController.m
    LIALinkedInHttpClient
    

    Change:

    NSString *accessTokenUrl = @"/uas/oauth2/accessToken?grant_type=authorization_code&code=%@&redirect_uri=%@&client_id=%@&client_secret=%@";
    

    By:

    NSString *accessTokenUrl = @"/oauth/v2/accessToken?grant_type=authorization_code&code=%@&redirect_uri=%@&client_id=%@&client_secret=%@";
    
    0 讨论(0)
  • 2021-01-07 05:45

    May this information help you -

    enter image description here

    API Terms of Use

    Transition Guide

    0 讨论(0)
  • 2021-01-07 05:50

    I also faced the same problem .My error was Error Domain=LIALinkedInERROR Code=2. On 26th May , 2016 the Linkedin has again made some changes due to which extra '#!' are added to the state and as a result ,the state do not match in LIALinkedInAuthorizationViewController class. So the solution is to remove those 2 characters either by replacing string or by checking contain string.

    In the else part of this method - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    change to `

          NSString *receivedState = [[self extractGetParameter:@"state" fromURLString: url] stringByReplacingOccurrencesOfString:@"#!" withString:@""];
    

    ` or apply contains string so that the state is matched completely.

    I know its kind of a weird solution but that did the trick for me. Hope it helps you as well. All the best

    0 讨论(0)
提交回复
热议问题