Post link to Facebook including app URL scheme - iOS 6 - ios

I'm using the UIActivityViewController to share an image and url from within my app.
I'm having trouble formatting the facebook post. I attach an image using a subclassed UIActivityItemProvider and provide the text for the post in the same way.
I want to add a url, but it needs my apps custom url scheme in front of it like this
myurl://image?url=http://imageurl.com
The problem is, when this is posted, only the last half of the url is clickable (from http:// onwards). Which means it doesn't open my app with the url.
Is there another way to do this?
I know I can create an app on Facebook, but how can I tie the two together using the UIActivityViewController?
Thanks

You have 2 options :
Create a simple server-side web service that will redirect from http://yourserver.com/linkToApp/image to myurl://image .
It could even show a different page/preview if the app is not installed/if you're not on an ios device.
Create a facebook app and use "Deep linking" (it will basically do the same for you..)

Related

Set your app to detect and open when a specific link is clicked - Xcode, Swft 4

I'm currently working on an iOS app, Swift 4, that automatically launches on click of a link to block users from accidentally navigating to that link.
How would I set this up?
For example, YouTube opens up youtube.com links.
Sorry if this is a vague question, if more info is required feel free to ask ^^
If you create a custom URL protocol like myapp://somepath (where myapp is the protocol) then you just register that custom protocol, and when the user clicks such a link it’ll automatically open your app. You can’t intercept a general purpose URL protocol like HTTP or YouTube.
(At least not without OS support. That's how YouTube and the app store are able to open HTTP links.)
I haven't done anything like this so far but it seems like you should take a look at Apple URL Scheme and Universal Links:
https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
https://coderwall.com/p/mtjaeq/ios-custom-url-scheme
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
https://www.raywenderlich.com/128948/universal-links-make-connection?utm_source=raywenderlich.com%20Weekly&utm_campaign=95f29cf4fc-raywenderlich_com_Weekly5_31_2016&utm_medium=email&utm_term=0_83b6edc87f-95f29cf4fc-415182745

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 8 UIActivity: disable specific third-party sharers?

I'm fighting with UIActivityViewController in iOS 8. I'd built a custom Pinterest sharing mechanism which works beautifully in iOS 7 -- specifically, it uploads an image to my server, and then creates a Pin with that image and a URL which I specify. This is the desired functionality.
Now, in iOS 8, Pinterest has implemented its own sharer, which accepts either a URL or an image. If a URL is included in the list of Activity Items, the sharer pops up and asks the user which image s/he wants to share from the page at that URL, and totally ignores the image which is also in the list of Activity Items. If there's no URL, and just the image, then the uploaded pin doesn't include a URL.
In order to resolve this, I need to do one of these things:
Disallow Pinterest's sharer from appearing in the list, so my customized sharer can show up instead;
Somehow specify a Source URL within a pin of an image using Pinterest's sharer (I doubt this is possible);
Remove all the other images from the generated web page. I'd really rather not do this.
Or if all else fails, it would be useful to at least be able to detect if the user has Pinterest's sharer selected to show up in their list.
Does anyone know if there's a way to achieve any of these things?
Just an idea, you could set a custom UIActivitySource on your UIActivityViewController.
Then check the incoming activity type for Pinterest. Then disable that via the exclusions.

How to launch directly to the post review page in Facebook iOS app with custom url?

I know that Facebook's custom URL scheme for iOS goes pretty deep, but I'm not sure if it would be possible to link directly to the post review page for a business.
I can launch to the business page with this URL:
fb://profile/323276694418242
But I'd like to launch directly to this page:
I have been attempting to find an answer to this for 2 years now, and the closest I've come is linking to the Reviews "screen" of the app by using the mobile web URL and not even the fb:// URL scheme. For example, https://m.facebook.com/pg/PAGE_NAME/reviews/ If the person has the app installed on their phone, this works. From there the user must tap the stars to leave their review.
Has anyone discovered a better solution, closer to what novicePrgrmr was asking originally?
Some URL schemes are listed here http://wiki.akosma.com/IPhone_URL_Schemes#Facebook. There's nothing about URL schemes in official documentation, so it may be unreliable.
fb://page/(fbid) will work to open to a specific page.
In Reviews documentation we have the following format https://graph.facebook.com/2345053339/reviews.
Try to derive URL scheme from this: fb://page/(fbid)/reviews or something similar.

Custom URL Scheme for sharing URL in native Facebook iPhone App

I know the available custom URL schemes for the native Facebook iPhone App:
What are all the custom URL schemes supported by the Facebook iPhone app?
But I can't find a way to publish a URL to my wall / timeline in that way, that Facebook collects / shows the site title and thumbnail as it does with the touch.facebook.com/sharer.php file.
The only way I see so far is to call
fb://publish/?text=www.domain.com
but this only post the link to my timeline, not title, thumbnail and site description.
Does anyone know a better way?
Basically you have two options:
You can either launch Safari using the Feed Dialog URL Scheme as explained here or use Facebook SDK as explained here.
If your App isn't integrated with Facebook already, it's probably easier to go with the first one.

Resources