问题描述
我已经仔细检查了一切,根据我的理解,这就是我需要做的全部:
I've double checked everything, from my understanding this is all I need to do:
self.inviteContent = [[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:@"http://mywebsite.com"]];
[FBSDKAppInviteDialog showWithContent:self.inviteContent delegate:self];
在mywebsite.com上我在标题中有这个(此处显示的示例值):
On mywebsite.com I have this in the heading (example values shown here):
<html>
<head>
<title>My Website</title>
<meta property="al:ios:url" content="appurl://action">
<meta property="al:ios:app_store_id" content="1234567">
<meta property="al:ios:app_name" content="My App">
</head>
<body>
...
</body>
</html>
因此,对话框会切换到最新的Facebook iOS应用程序。我写了一条消息,然后选择我要发送邀请的人,点击发送,我收到此错误:
So the dialog switches over the to the latest Facebook iOS app. I write a message and pick the person I want to send the invite to, hit send and I get this error:
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.
我做错了什么?
我的应用处理自定义网址很好,因为如果我在Mobile Safari中输入 appurl:// action
,它会打开我的应用。
My app handles the custom URL fine because if I enter appurl://action
in Mobile Safari it opens my app up.
推荐答案
您需要从此处创建一个AppLink URL,
You need to create an AppLink URL from here, https://developers.facebook.com/quickstarts/?platform=app-links-host
- 从列表中选择您的申请
- 填写表格并提供相同的信息
- 点击下一步!
- 你已经完成了。
- Choose your application from the list
- Fill up the form with equivalent information
- Click on Next !
- You're done.
现在,您可以将该链接与您的代码一起用于邀请。
Now, you can use that link with your code for invite.
self.inviteContent = [[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:APP_LINK_HERE]];
[FBSDKAppInviteDialog showWithContent:self.inviteContent delegate:self];
该链接的格式将是这样的,
The format of that link will be something like this,
PS所有的x都将被一个数字替换。
P.S. all x's will be replace by a digit.
这篇关于Facebook App邀请iOS v4 SDK错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!