iOS使用UIActivityViewController将图像共享到LinkedIn [英] iOS Sharing Image to LinkedIn using UIActivityViewController

查看:225
本文介绍了iOS使用UIActivityViewController将图像共享到LinkedIn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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正在列表中显示UIActivityViewController中的共享操作,当我点击它时,它显示一个带有图像的对话框,我已将其添加为活动项目,但它没有发布到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.

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

Tested successfully for Google+, FB and Twitter.

如果我分享网址,则会将其发布到LinkedIn应用。只有图片没有发布。

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

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

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");
                                 }];

}

推荐答案

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

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.

作为一种解决方案,我不会分享activityType为 com.linkedin.LinkedIn.ShareExtension

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

这篇关于iOS使用UIActivityViewController将图像共享到LinkedIn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆