iOS使用UIActivityViewController将图像共享到LinkedIn

时间:2022-07-08 23:05:13

I'm trying to share image to all possible apps installed in my device. But unfortunately, I'm not able to post image successfully to LinkedIn (already installed and logged in as verified user).

我正在尝试将图像共享到我设备中安装的所有可能的应用程序。但不幸的是,我无法将图像成功发布到LinkedIn(已安装并以已验证用户身份登录)。

LinkedIn is being displayed in list of share actions in UIActivityViewController, when I tap on it, It displays a dialogue with image, which I have added as activity item, but it is not being posted to LinkedIn.

LinkedIn正在显示在UIActivityViewController中的共享操作列表中,当我点击它时,它显示一个带有图像的对话框,我已将其作为活动项添加,但它没有发布到LinkedIn。

Tested successfully for Google+, FB and Twitter.

已成功通过Google+,FB和Twitter测试。

If I share url, then it gets posted to LinkedIn app. Only image is not being posted.

如果我分享网址,那么它会被发布到LinkedIn应用程序。仅发布图像。

I got these lines in Console Log:

我在控制台日志中获得了这些行:

2015-05-06 19:27:54.369 Share[1659:309834] LaunchServices: invalidationHandler called 2015-05-06 19:27:59.824 Share[1659:309793] plugin com.linkedin.LinkedIn.ShareExtension invalidated

Here is the code i'm trying:

这是我正在尝试的代码:

- (IBAction)openShare:(id)sender{
UIImage *img1 = [UIImage imageNamed:@"Test1.jpg"];
NSString *str = @"iOS";
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];

UIActivityViewController *activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:@[img1,url,str]
                                  applicationActivities:nil];

[self presentViewController:activityViewController
                                   animated:YES
                                 completion:^{
                                     NSLog(@"completed");
                                 }];

}

1 个解决方案

#1


I'm having the same problem. Anytime i try to share a photo, even when is only a photo i get an error and the share is not performed correctly.

我遇到了同样的问题。任何时候我尝试分享照片,即使只是一张照片我得​​到一个错误,并且共享没有正确执行。

As a solution i'm not sharing the photo when the activityType is com.linkedin.LinkedIn.ShareExtension

作为解决方案,当activityType为com.linkedin.LinkedIn.ShareExtension时,我不会共享照片

#1


I'm having the same problem. Anytime i try to share a photo, even when is only a photo i get an error and the share is not performed correctly.

我遇到了同样的问题。任何时候我尝试分享照片,即使只是一张照片我得​​到一个错误,并且共享没有正确执行。

As a solution i'm not sharing the photo when the activityType is com.linkedin.LinkedIn.ShareExtension

作为解决方案,当activityType为com.linkedin.LinkedIn.ShareExtension时,我不会共享照片