So I'm trying out the new UIActivityViewController
in iOS 6, and it's really easy to get up and running, but I can't figure out how to control it like I want. So I want to post a link to an article and I also want to attach an image for the link. I DON'T want that image uploaded to some facebook album, just as a URL thumbnail.
This is easy to accomplish in the facebook SDK as they give full control for it, but is there a way to do it with the UIActivityViewController
? Here's what I got:
NSArray *activityItems = @[[NSURL URLWithString:[article link]], [UIImage imageNamed:@"myStockImage"]];
UIActivityViewController *viewCont = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:viewCont animated:YES completion:nil];
And this works, but it uploads the image to an 'iOS album'. If I don't add the image in the array, then the facebook sheet looks like it's blank and the attachment shows a grayed out safari logo (like the thumbnail is missing!) In safari when you try to Facebook a link, it uses a screen grab of the page as the thumbnail, I want to do something like that
UPDATE :
So here's what it looks like from my app (using UIActivityViewController or the SLCompose way). See how it is going to upload the picture to a photo album iOS Photos
Here's what I want it to look like (see Safari also) :
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…