[英]post image to facebook friend's wall
Im using UIActivityViewController
for share image to social network. 我使用UIActivityViewController
共享图像到社交网络。 I need to post my image to friend's wall. 我需要将图片发布到朋友的墙上。 Is it possible to post image to friend's wall using UIActivityViewController. 是否可以使用UIActivityViewController将图像发布到朋友的墙上。
With NSData
, you can add image to UIActivityViewController
. 使用NSData
,可以将图像添加到UIActivityViewController
。 Try below one. 请尝试以下一项。
NSString *text = @"your text goes here";
NSData *Da = UIImageJPEGRepresentation([UIImage imageNamed:@"Icon.png"], 1.0);
NSArray * activityItems = @[text,Da];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:[NSArray arrayWithObjects:nil]];
activityVC.excludedActivityTypes = @[UIActivityTypePostToWeibo]; //or whichever you don't need
[activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
}];
[self presentViewController:activityVC animated:YES completion:nil];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.