Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use <a href="https://github.com/pmilanez/MIS-Linkedin-Share" rel="nofollow">MIS-LinkedIn-Share</a> for sharing url.</p> <p>Just write following code to share.</p> <pre><code>- (IBAction)share:(id)sender { [[MISLinkedinShare sharedInstance] shareContent:self postTitle:@"Title" postDescription:@"Description" postURL:@"http://www.youtube.com/watch?v=_FaWTNEyG80" postImageURL:@"http://www.google.com/images/errors/logo_sm.gif"]; } </code></pre> <p>don't forget to set api and secret key before sharing.</p> <p><strong>OR</strong></p> <p>you can also use method with <a href="http://hdgreetings.typepad.com/files/oauthstarterkit_ios_1_1.zip" rel="nofollow">oAuthStarterkit</a> to share url :-</p> <p>Here is working code for oAuthStarterKit</p> <p><strong>1) Open the file OAuthLoginView.m</strong></p> <p><strong>2) Find the method initLinkedInApi, add your api and secret keys here.</strong></p> <p><strong>3)Comment lines on viewDidAppear in OAuthLoginView as</strong></p> <pre><code>- (void)viewDidAppear:(BOOL)animated { if ([apikey length] &lt; 64 || [secretkey length] &lt; 64) { // UIAlertView *alert = [[UIAlertView alloc] // initWithTitle: @"OAuth Starter Kit" // message: @"You must add your apikey and secretkey. See the project file readme.txt" // delegate: nil // cancelButtonTitle:@"OK" // otherButtonTitles:nil]; // [alert show]; // [alert release]; // // // Notify parent and close this view // [[NSNotificationCenter defaultCenter] // postNotificationName:@"loginViewDidFinish" // object:self // userInfo:self.profile]; // [self dismissModalViewControllerAnimated:YES]; } [self requestTokenFromProvider]; } - (void)shareImp { NSLog(@"share Imp called "); NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/shares"]; OAMutableURLRequest *request =[[OAMutableURLRequest alloc] initWithURL:url consumer:consumer token:self.accessToken callback:nil signatureProvider:nil]; 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"]; [contents setValue:@"http://economy.blog.ocregister.com/files/2009/01/linkedin-logo.jpg" forKey:@"submitted-image-url"]; 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"]; NSMutableData *data = [[NSMutableData alloc] init]; NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; [archiver encodeObject:updatedic forKey:@"share"]; [archiver finishEncoding]; [archiver release]; NSLog(@"post dictionary is %@",updatedic); NSData *postData=[NSData dataWithData:data]; [request setValue:@"json" forHTTPHeaderField:@"x-li-format"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [request setValue:[NSString stringWithFormat:@"%d",[postData length]] forHTTPHeaderField:@"Content-Length"]; [request setHTTPBody:postData]; [request setHTTPMethod:@"POST"]; OADataFetcher *fetcher = [[OADataFetcher alloc] init]; [fetcher fetchDataWithRequest:request delegate:self didFinishSelector:@selector(postUpdateApiCallResult:didFinish:) didFailSelector:@selector(postUpdateApiCallResult:didFail:)]; [request release]; } - (void)postUpdateApiCallResult:(OAServiceTicket *)ticket didFinish:(NSData *)data { NSLog(@"did finish called "); NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"response body after posting is %@",responseBody); [responseBody release]; [self dismissModalViewControllerAnimated:YES]; } - (void)postUpdateApiCallResult:(OAServiceTicket *)ticket didFail:(NSData *)error { NSLog(@"%@",[error description]); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload