Ashok
Ashok

Reputation: 5655

Sharing an image in LinkedIn integration in iPhone

We can share a message(text) through LinkedIn integration in iPhone Apps.....

But Is there any possibility to share a local image or url image through LinkedIn integration in iPhone Apps......?

Thanks In Advance.....

Upvotes: 0

Views: 3341

Answers (2)

Vishal
Vishal

Reputation: 8256

I think no.I was able to send text to LinkedIn via share kit . But I was not unable to upload image to LinkedIn. So, I think it is not possible.

Upvotes: 1

Ashok
Ashok

Reputation: 5655

Any how i got a relative solution...

Sharing an image in LinkedIn integration in iPhone---->

NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/shares"];
OAMutableURLRequest *request = 
[[OAMutableURLRequest alloc] initWithURL:url
                                consumer:oAuthLoginView.consumer
                                   token:oAuthLoginView.accessToken
                                callback:nil
                       signatureProvider:nil];

NSDictionary *update = [[NSDictionary alloc] initWithObjectsAndKeys:
                        [[NSDictionary alloc] 
                         initWithObjectsAndKeys:
                         @"anyone",@"code",nil], @"visibility", 
                        statusTextView.text, @"comment",[[NSDictionary alloc]
                                                         initWithObjectsAndKeys:
                                                         @"description goes here",@"description",
                                                         @"www.google.com",@"submittedUrl",
                                                         @"title goes here",@"title",
                                                         @"http://economy.blog.ocregister.com/files/2009/01/linkedin-logo.jpg",@"submittedImageUrl",nil],@"content", nil];

[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSString *updateString = [update JSONString];

[request setHTTPBodyWithString:updateString];
[request setHTTPMethod:@"POST"];

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

Upvotes: 2

Related Questions