Post a link to Facebook, including the URL scheme of the application - iOS 6

I am using UIActivityViewController to share image and url from my application. I'm having trouble formatting a post on facebook. I attach the image using a subclass of UIActivityItemProvider and provide the text for the message in the same way.

I want to add a URL, but he needs a special URL scheme for my applications before this myurl://image?url=http://imageurl.com

The problem is that when this is posted, only the last half of the URL is clickable (from http: // onwards). This means that it does not open my application with a url.

Is there any other way to do this? I know that I can create an application on Facebook, but how can I link them together using the UIActivityViewController ?

thanks

+6
source share
1 answer

You have 2 options:

  • Create a simple server-side web service that will be redirected from http://yourserver.com/linkToApp/image to myurl://image .
    It may even show another page / view if the application is not installed / if you are not on an ios device.

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

+4
source

Source: https://habr.com/ru/post/949743/


All Articles