Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post link to Facebook including app URL scheme - iOS 6

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

like image 417
Darren Avatar asked Jul 18 '13 12:07

Darren


People also ask

How do I add a deep link to my Facebook app?

If you have select App Installs as your objective you can add a Deferred Deep Link. In the Ads Manager, select New AdSet and scroll to Ad Creative. Add your deep link or a URL with Facebook App Links metadata implemented to take users to a specific location in the app after installing.

How do I support Deferred deep linking in my Facebook app?

The Facebook SDK for iOS and Android includes the product App Links, which will enable you to support deferred deep linking in your app. In addition to your deep link implementation, just add the following code to your app to handle deferred deep links:

What programming language is the new Facebook app built in?

The new Facebook app is built using Objective-C as against previous once in HTML5 which used to support URL scheme mechanism. This link gives a hint on that.

What is a custom URL scheme in Salesforce?

A custom URL scheme is a mechanism through which third-party apps can communicate with each other. It doesn't allow you the provision to open a page in that particular application. It just fires an event to bring the called Application to the foreground.


1 Answers

You have 2 options :

  1. 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.

  2. Create a facebook app and use "Deep linking" (it will basically do the same for you..)

like image 162
Nir Golan Avatar answered Oct 17 '22 01:10

Nir Golan