« iPhone / iPad OAuth for LinkedIn, Facebook, Twitter | Main | Quantum Mechanics, Negative Entropy, and Super-fast Computers »

March 20, 2011

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fc3203e8834014e86d85b30970d

Listed below are links to weblogs that reference iPhone OAuth Starter Kit for LinkedIn:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Haresh

Hello,

Thanks for this amazing code, it saves my lots of time.

But i have one problem.

When i run your demo code then it retrieves AccessToken successfully and when i try on my code then it faild and return some body response with oauth_token, oauth_secret and oauth_varifier (Null)...so do you know that what is the problem.

And one more thing how can i retrieve oauth_token and oauth_secret from AccessToken's body response?

Thanks for your great help.

staff

Hi Haresh,

Is the testApi method working for you that displays your name and headline?

Or is it a separate api call that is not working?

To answer you last question where to get oauth_token and oauth_token_secret, those values are automatically extracted and placed into the "accessToken" variable.

After accessToken has been set by the code, you can see the properties are there in the console window by typing: "po accessToken". This will display the values you mention.

requestToken works the same way but you don't need requestToken for api calls, requestToken is needed only for the initial authorization.

Haresh

Thanks for your reply.

But i am facing strange problem. Your source code is working fine on simulator but its not loading on webview on device. I have checked your source code, it gives me same results, plz click on Get Linkedin Profile and it doesn't display anything on device but it works fine on simulator.

Can you plz guide me if you have solved that problem?

Thanks so much.

Haresh

hello,

i got the problem, it showing me We were unable to find the authorization token, error in device.

Can u plz tell me that how to fix it?

Regards,
Haresh.

staff

Haresh,

I've updated the project, please give it another try. This version I tested on the iPhone 4, and iPad 1, both are working fine.

Lee

Tuma

Hello Lee, i found very useful your code, but i0m trying to implements an oauth 1.0a with uso of a pin after the user login.
Have you an idea on how to di this starting from your project?
Thanks in advice!
Tuma

Lee Whitney

Hi Tuma,

Are you sure you want to insist that the user enter a PIN as part of the login?

Entering a PIN is an "Out of Band" (OOB) approach to OAuth and more work for the user compared to entering their username and password.

Fvisticot

Hello,
Congratulation for your job !!!
I try for several hours to use the Invite API with id (not email).
I try to use you library.
1. Your sample code is working on my iPhone
2. I try to replace your testCallApi with the following code to use the InviteById feature:
This API needs to use a POST Method with XML inside.
Using my code, i have a 401 UnAuthenticated Error...
Do you have sample code to send this kind of "POST" request with your API ?

Thank you for your help.

- (void)testApiCall
{

NSString * requestString= @"\
\
\
\
\
\
\
Invitation to Connect\
Please join my professional network on LinkedIn.\
\
\
friend\
\
NAME_SEARCH\
y6Xn\
\
\
\
";

NSURL *url = [NSURL URLWithString:@"https://api.linkedin.com/v1/people/~/mailbox"];
OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL:url
consumer:consumer
token:self.accessToken
callback:nil
signatureProvider:nil];
[request setHTTPMethod:@"POST"];
[request prepare];


[request setHTTPBody:[requestString dataUsingEncoding:NSUTF8StringEncoding]];

//[request setValue:@"json" forHTTPHeaderField:@"x-li-format"]; //not used, want to send XML

OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
delegate:self
didFinishSelector:@selector(testApiCallResult:didFinish:)
didFailSelector:@selector(testApiCallResult:didFail:)];
[request release];
}

Lee

Hi Fred,

Kirsten at LinkedIn has updated the project to include an add update sample post.

This should give you an idea of how to do write operations. You can get the updated version here:
https://github.com/synedra/LinkedIn-OAuth-Sample-Client

Please check it out and either of us would be glad to answer more questions.

Regards

Steve

Hey thanks for the contribution to the community.

I'm interested in creating more or less the equivalent for the Mac desktop [ yeah they still do exist :-) ]

Most desktop application developers have yet to move to XC4 because of legacy issues.
So I'll be back this down to XC3 for more universal appeal.

Is there any functionality that REQUIRES XC4?
Is there any gotchas here that I should be aware of moving this to Cocoa?

Lee

Hi Steve,

I only say XCode 4.01 is required because that is what I used and what I can guarantee will work.

However I haven't intentionally precluded XCode 3.x from working. So it might just work no problem.

If you find anything that needs to be fixed I would be glad to help out.

thanks-

Dexter

Hi Lee,

Great work!! I am pretty new to iOS dev and OAuth. Could you please let me know how could I share update on Linkedin. I tried looking up but I could not find any good tutorials.

Thanks,
Dexter

Dallas West

Just a quick heads up for any newbies out there like myself. I grabbed the latest version of the code from git hub and I couldn't get it to accept my api key for the life of me. Here's the fix... I dunno if this is something new that linked in is doing, but my key and secret were less than 64 characters in length.

So just change the viewdidappear code to lower the length values and your money. I lowered mine to 1 and now I'm rockin and rolling.

- (void)viewDidAppear:(BOOL)animated
{
if ([apikey length] < 1 || [secretkey length] < 1)

Thanks again for putting this together!

Marcela Kashiwagi Silveira

Hi,
Thanks for sharing your source code.
I'm trying to test it, but something is wrong in my api key and secret.
I checked it a thousand times and it's correct, but when I log it, the api key length is 12 and the secret length is 16, when it should be 64, right?
Any idea what's going on?

omkarnath shashtri

hi,
I use this code for invitation using the email but every time I got the error of UNAuthororized message...

any one know how can solve this....

Thanks in advance.

david

Hello,

I'm also facing the same problem....

I receive the response every time same.

401
1313505575052
CS5OHFZ6UE
0
Unknown authentication scheme


Scholl1991

I want to enter my login and password every time when i touch "Get LinkedIn Profile" button?? Anybody help me?

khaled

i get the secret key and api key from linked in website and put them in the right place in code then i run the demo when i try to put Name & headline it give me exception in Main function EXC_BAD_ACC
and when i try to click on the button without fill the textfeilds it tell me to put your API key and secret key

how can i solve this problem

Test

How to logout using linkedin api ?

shilpa

hi,
i downloaded this iphone proj. I added API key and SECRET key alos. when i run the app and click on "Get Linkedin profile" it's always telling me "You must add apikey and secret key .see the project file Readme.txt ".

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.