Garlen
Garlen

Reputation: 424

Facebook FBSDKAppInviteContent - Missing App Link URL

Do you need to have your own website with meta tags for your app link url to use the FBSDKAppInviteContent and FBSDKAppInviteDialog to invite friends?. If I put just the app link url there,

It shows an error saying something like

Missing App Link URL The app link used with this invite does not contain an Android or iOS URL. Developers are required to enter a URL for at least one platform.

I'm using facebook-sdk iOS and also fbsdksharekit. Does anyone know how to solve this error or warning?

Upvotes: 13

Views: 12726

Answers (5)

Ahmad Moussa
Ahmad Moussa

Reputation: 1324

Maybe Facebook App Links Hosting API will be of help

"If your application doesn't have a website for content you want to share to Facebook, you don't have public web URLs which you can annotate to support App Links.

For these types of apps, Facebook provides an App Links Hosting API that will host App Links for you. With the Hosting API you can create and manage your App Links for all the mobile environments you support."

Source: https://developers.facebook.com/docs/applinks/hosting-api

Upvotes: 2

Mark Pazon
Mark Pazon

Reputation: 6205

In addition to the other answers it is also nice to know that you can use https://developers.facebook.com/tools/debug/ to refresh your applink url's scrape information. If you initially placed incorrect values in the meta tags it will not be refreshed right away unless you go to that link and explicitly refresh it.

Upvotes: 3

pk75
pk75

Reputation: 511

Adding meta tags would solve this, this is snippet of html from app link created via FB. Fb is adding some extra meta tags on it's app link url page, and it also redirects direct to itunes if opened on a browser.

<html>
<head>
	<title>app name</title>
	<meta property="fb:app_id" content="your fb app id" />
	<meta property="al:ios:url" content="Your app link url" />
	<meta property="al:ios:app_name" content="your app name" />
	<meta property="al:ios:app_store_id" content="your app id" />
	<meta property="al:web:should_fallback" content="false" />
	<meta http-equiv="refresh" content="0;url=https://itunes.apple.com/WebObjects/MZStore.woa/wa/redirectToContent?id=your app store id" />
</head>
<body>
	Redirecting...
</body>
</html>

Upvotes: 1

Garlen
Garlen

Reputation: 424

For those who want know and asking how does it work, appLinkUrl is not the url of your app in the market. Here's the way I did this.

  • You need to make your own appLinkUrl and put it in your info.plist(see:http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html) that you'll be using for deepLinking.
  • Then after you declare it on your info.plist, you must have at least an html web page where you can put the meta tags for the appLinks of ios or android(https://applinks.org). Take note the the appLinkUrl that you have put on your info.plist should be the same on your meta property="al:ios:url
  • Debug your website url and check your meta tags using facebook url debugger. Press "Fetch new scrape information" to update the meta tags for any changes on it.
  • Use the link of your webpage that has the meta tags and use it like on the sample on facebook docs

    FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init]; content.appLinkURL = [NSURL URLWithString:@"your_website_link_with_metatags"];

  • Just make sure your meta tags have the right information and that's it!

Upvotes: 8

Vizllx
Vizllx

Reputation: 9246

Yes, You have to add meta tags of your app link url in your website.


iOS

As an example, let's say you've got a page located at:

http://example.com/applinks

In that page you need to add some metadata to describe what app will handle it:

<html>
<head>
    <meta property="al:ios:url" content="example://applinks" />
    <meta property="al:ios:app_store_id" content="12345" />
    <meta property="al:ios:app_name" content="Example App" />
    <meta property="og:title" content="example page title" />
    <meta property="og:type" content="website" />
    <!-- Other headers -->
</head>
<!-- Other HTML content -->
</html>
</head>

Upvotes: 11

Related Questions