Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TWTweetComposeViewController doesn't show link preview

Tags:

ios

twitter

ios5

When I add a link to a tweet in the TWTweetComposeViewController, I see the link attached correctly:

enter image description here

But unlike when I do so in Safari, the link doesn't show a preview of the URL like Safari (or Youtube) does:

enter image description here

Do you know if it's a hidden feature or if it depends on the Link added to the tweet?

Thank you!

like image 717
Mathieu Avatar asked Oct 30 '11 16:10

Mathieu


People also ask

Why is Facebook link preview not working?

You might not be seeing the Facebook link preview you want because the info has been cached by Facebook. (Facebook saves the info from URLs and pages that have already been shared, for better performance.) So you just may need to force Facebook to clear the cache.

How do you get a twitter preview link?

After entering you link in a tweet, Twitter will automatically grab a preview for the link. Once you see the preview, there will be a “X” on the image that if you press will hide your Twitter preview link from being published. What is link preview? A link preview is a visual preview of the content on a website.

How do I fix the link preview on facebook?

Make sure you're on the 'Sharing Debugger' tab, then simply put the address into text field and click the button that says 'Debug'. Head back to your post, refresh the page and type the address in again. Tada! You're Link preview should show up.

How do I preview a link on my Iphone?

Touch and hold a link in Safari to see a preview of the link without opening the page. To open the link, tap the preview, or choose Open.


1 Answers

This has been my experience as well, if you attach a URL the TWTweetComposeViewController will not automatically add a preview image.

I was curious so I took a look at the private runtime headers for Twitter.framework and I found a few interesting methods, including - (BOOL)addURL:(id)arg1 withPreviewImage:(id)arg2;. Using this in my app I found it worked exactly as expected, the tweet view showed a link along with the image I included. Unfortunately this doesn't help too much, since it's a private method your app will almost certainly be rejected if you try to use it in the App Store.

like image 79
Marc Charbonneau Avatar answered Sep 20 '22 06:09

Marc Charbonneau