0

I would like to link to my iOS app from the Facebook main button of my business page. However this seems very tricky.
This is from the documentation of Facebook: https://developers.facebook.com/docs/applinks/ios

The example is in Objective-C. Does anyone have some guidance how to do that in Swift?

Stefan Badertscher
  • 331
  • 1
  • 6
  • 20
  • I have written a detailed solution document under this question: https://stackoverflow.com/questions/46266797/deeplink-solution-for-ios-and-android-apps-works-in-facebook – Mustafa Atalar Sep 17 '17 at 18:25

1 Answers1

1

Assuming you have a URL scheme configured in your app, this actually doesn't require any additional code work to implement. Here would be the steps:

  1. Go to your app page on Facebook and edit the button.
  2. Under the iOS Settings section, open the dropdown menu and select App enter image description here
  3. In the next section, enter a URI using your app's custom URI scheme and a fallback website URL to use if your app is not installed (perhaps a page on your website, or a link directly to the iTunes store page)

enter image description here

Note: using the custom URI scheme only works acceptably in this case because Facebook is providing fallback functionality for another destination when the app is not installed. In any other place, if you opened your app's URI scheme without it being installed, you would instead get an ugly 'address could not be found' error. Obviously this is bad for user experience, so if you want to do conditional linking like this anywhere else, you can use a tool like Branch.io (full disclosure: I'm on the team) to handle it.

Graham
  • 7,431
  • 18
  • 59
  • 84
Alex Bauer
  • 13,147
  • 1
  • 27
  • 44