Can't share to linkedin using UIActivityViewController
Asked Answered
H

2

12

I can't share anything via linkedin using UIActivityViewController. While I tap share via linkedin, it opens the sharing pop up and dismisses immediately after opened it. All other sharing are working fine. Could you please tell me a solution? Thanks.

Note: my project is in ios9 and xcode version is 7

and my error log shows : plugin com.linkedin.LinkedIn.ShareExtension interrupted

Heartstricken answered 27/10, 2015 at 9:5 Comment(3)
I'm also having this problem. Ideally I would be able to share a UIImage, NSUrl, and NSString. I've tried returning nil for each or all of these for the case of LinkedIn to no avail.Levitus
@Mumthezir have you resolved this issue?Clausewitz
@Mumthezir hey, I dont even see linkedin on my UIActivityViewController, did you implement a custom activityType?Whiles
S
4

The iOS 8 extensions cannot be presented in a custom share screen. You absolutely have to use UIActivityViewController in order for the share/action extensions to appear.

Singles answered 27/10, 2015 at 12:14 Comment(2)
we are using the same UIActivityViewController.Heartstricken
One change is to use image object instead of NSData object in UIAcitvityViewController but that's also not working with LinkedIn.!Bea
A
0

Have you written the code like this

DataItemProvider *dataToShare = [[DataItemProvider alloc] initWithPlaceholderItem:FileTypeToShare];

LinkedInActivityType *linkedinActivity = [[LinkedInActivityType alloc] init];

NSArray *activityTypes = @[linkedinActivity];
NSArray *activityItems = @[dataToShare];

UIActivityViewController *activityController = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:activityTypes];

[activityController setCompletionHandler:^(NSString *activityType, BOOL completed) {
    //Put in your completion handle code here.
}];

[self presentViewController:activityController animated:YES completion:nil];
Autecology answered 27/10, 2015 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.