I would like to share an image (an UIImage) with some pre-defined text to Facebook. I achieved this in iOS 6.0 and afterwards with the Social Framework. However this is not available in iOS 5, so I would like to know if this is possible. I considered the web dialog but seems it only support to share image through an URL, but not an UIImage.
Thanks!
Try this..
NSString *texttoshare = @"Your text";
UIImage *imagetoshare = [[UIImage alloc]init];
imagetoshare=[UIImage imageNamed:@"shareImage.png"];
NSArray *activityItems = @[texttoshare, imagetoshare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint];
[self presentViewController:activityVC animated:TRUE completion:nil];
Hope this will helpful to you... Thank you
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.