Show preview of URL while entering a link in UITextView - ios

I need to show a preview of a URL (like FB and WhatsApp do), while the user is entering a link in a UITextView.
Is there a library on iOS to grab it, or do we have to make our own?
Thanks in advance.

iOS does not provide this functionality by default.
You will have to build your own or use an open source solution.
This project might provide what you need:
https://github.com/itsmeichigo/URLPreview

Related

Facebook call to action ios app link

When trying to use Call To Action button into facebook to add "Use Application" button on my page, it asks for my ios app link but I don't know what to fill there. I've tried many things without success :
myAppName://
myBundleId://
myStoreId://
Do you know how to build that app link please ?
Thanks in advance.
The Facebook documentation on App Links should help you with your problem:
https://developers.facebook.com/docs/applinks
Basically you need to setup a URL that has <meta> HTML content which Facebook uses to identify your app and deep link to it. You will need to configure for deep linking in your app too.

Link to open up iOS app from facebook and twitter page and other ios app?

Hi I have a requirement in my app. From my ios Application(myapp),i share a link to facebook. Then I opened up my facebook account in browser or Facebook application and clicked the link, link should open in myapp if myapp is installed in the device otherwise link should open in browser. How can I achieve this ? Please suggest me step by step. Thanks in advance for your consideration and help.
I am not sure if this is possible. I have looked at various questions including
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
as I am sure you might have already done but these questions target their own app, mainly web app, but you want that behavior to occur from an app that is not yours like twitter or facebook. But what you can do is show them two links on facebook/twitter, if they have installed press link 1 and if they want to install, press link 2 and you can pass parameters in link 1 as you might already know.
I will also keep checking answer of this question if some one comes and gives a better solution.
There is an option called custom URL scheme in iOS. It will help you to create a URL scheme which identifies your application. You can post link with this URL scheme and when you tap on this link on your iOS device it will open up your mobile app. Please see the link below to know how to setup this.
Custom URL Scheme in iOS
This is called 'deep URL linking'. Facebook have built a service called 'App Links', which seems pretty cool.
https://developers.facebook.com/docs/ios/app-links

iOS open with specific apps

I'm trying to show apps from UIDocumentInteractionControllerDelegate , default apple apps like; sms, email or UIPasteBoard (Facebook and Twitter is optional) . Just like the similar of Dropbox app :
How can I handle this kind of situation? I've done already open apps from their UTI's, open just email or just sms but I don't how to show all of them in one sheet.
Thanx
I believe you're looking at an UIActivityController instead of a UIDocumentInteractionController, which I believe Apple is trying to phase out.
Check out the docs here https://developer.apple.com/library/ios/documentation/uikit/reference/UIActivityViewController_Class/Reference/Reference.html
You should try QLPreviewController. This will give you desired result.
https://developer.apple.com/library/ios/Documentation/NetworkingInternet/Reference/QLPreviewController_Class/Reference/Reference.html

iOS: Adding a Facebook Like button to a native iPhone app

I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user's Facebook page.
Facebook writes: "Currently, the Like button is only available in mobile web apps".
My app is a native app and not a web app, so therefore I assume it's not possible. However, I do assume that it is possible to mix native UI components on a screen along with web components and therefore it might be possible to implement the Like button, although I am not sure how you pass data from the native portion to the web portion.
If the only solution is a hack, then I won't implement it because at some point the hack will fail when Facebook alters their API.
read around SO a little, you get many leads. Here's one:
Like button in iOS application
And a comment points to github.com/brow/FacebookLikeView
It has same caveats, but it seems there aren't any magic solutions.
There are these blogposts as well:
http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html
http://petersteinberger.com/2010/06/add-facebook-like-button-with-facebook-connect-iphone-sdk/
But not sure you get a native UIButton. Maybe you can open a webview in the background and emulate a click on it...
GL, update if you have some findings,
Oded.
Now you can use the FBlike button using the following code but it need to download latest sdk and it is the beta version :(
Here is the code:
[FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
[FBSettings enablePlatformCompatibility:NO];
FBLikeControl *like = [[FBLikeControl alloc] init];
like.objectID = #"http://shareitexampleapp.parseapp.com/photo1/";
like.likeControlHorizontalAlignment=FBLikeControlHorizontalAlignmentRight;
like.likeControlStyle=FBLikeControlStyleBoxCount;
[self.view addSubview like];
It looks like Facebook finally decided to allow this, more directly, via the Open Graph API.
See documentation here
Check this out, FB just made it possible through their SDK. Only for testing and ios for now
https://developers.facebook.com/docs/ios/like-button/

TWTweetComposeViewController doesn't show link preview

When I add a link to a tweet in the TWTweetComposeViewController, I see the link attached correctly:
But unlike when I do so in Safari, the link doesn't show a preview of the URL like Safari (or Youtube) does:
Do you know if it's a hidden feature or if it depends on the Link added to the tweet?
Thank you!
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.

Resources