Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to share post/pics/link using IOSLinkedInAPI

    • 0
    • 2
    • 1
    • 2
    • 1
    • 0
    • 0
    • 0
    • 1.85k
    Comment on it

    Hello Reader's,


    I m using IOSLinkedinAPI to Share Video link to LinkedIn. But i m giving option to share picture URL , links and text post to LinkedIn.


    1. Install AFNetworking using pods.
    2. Download IOSLinkedinAPI and drag-drop "IOSLinkedInAPI" folder to project.
    3. Get MyLinkedInManager and DataObjects class from this link. MyLinkedInManager and DataObjects classes
    4. Create app on LinkedIn then Give clientId and clientSecurity of app in MyLinkedInManager .
    5. Give UIAlertViewDelegate to your view controller.
    6. Add button to share post to linkedin :-


        - (IBAction)shareToLinkedIn:(id)sender {
            [[MyLinkedInManager sharedManager] setLoginCompleted:^(id details) {
                UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Share to LinkedIn" message:@"Post Status :" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Share", nil];
                alert.alertViewStyle = UIAlertViewStylePlainTextInput;
                alert.delegate = self;
                [alert show];
            }];
            if (![[DataObjects sharedDataObjects]accessTokenForLinkedIn]) {
                [[MyLinkedInManager sharedManager]login];
            }
            else
            {
                UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Share to LinkedIn" message:@"Post Status :" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Share", nil];
                alert.alertViewStyle = UIAlertViewStylePlainTextInput;
                alert.delegate = self;
                [alert show];
            }
        }
    
    
    #pragma mark AlertView Delegate Method
    - (void)alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttoIndex
    {
        if (buttoIndex == 1) {
            NSString * poststr = [alert textFieldAtIndex:0].text;
            [[MyLinkedInManager sharedManager]sharetoLinkedIn:@"title" desc:@"description" path:@"https://c1.staticflickr.com/5/4022/4438173242_f78c3ea7fe.jpg"  imagePath:@"https://c1.staticflickr.com/5/4022/4438173242_f78c3ea7fe.jpg" postString:poststr];
        }
    }
    


    and now link shareToLinkedIn action to button in storyboard or xib file and share .

 1 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: