5

I notice that Mobile Safari's Twitter and Facebook share adds a screenshot of the current page without actually sharing it, eg:

Twitter Share from Mobile Safari Facebook share from Mobile Safari

Im trying to duplicate this via SLComposeViewController, however calling the addImage: actually adds the UIImage to the tweet/facebook album (as expected).

Is there a way to just display the screenshot of the page without adding the image ?

Edit: Looks like SLComposeViewController conforms to UIAppearanceContainer however the UI_APPEARANCE_SELECTOR is not documented.

Daniel
  • 23,129
  • 12
  • 109
  • 154
Sandeep Chayapathi
  • 1,490
  • 2
  • 13
  • 31

1 Answers1

0

Safari is previewing the screenshot to the website because it has it loaded and ready in on the screen, when you addURL: on the SLComposeViewController it doesn't resolve that URL and grab a preview.

Also when you addImage: that's exactly what it's doing, it's adding an image to your post, this isn't what you want, you just want to have a visual and not a safari logo/icon in place of the attachment indicating a link.

I can only say there is a private method on the SLComposeViewController class which is how Safari is adding a preview image for URLs added...

You should always get this in your app when sharing a URL:

enter image description here

That sucks, you should add a feature request (http://bugreport.apple.com) so that you can add your own preview here, maybe Apple will make that public in future iOS releases.

Daniel
  • 23,129
  • 12
  • 109
  • 154
  • There is a solution to find in the source code of this page :http://open.spotify.com/track/3RgkkFF7fVp8N15neDqQOL Cause when you use this url, the preview is different of the screen shot of this page – Damien Romito Aug 04 '14 at 04:45