我已经仔细检查了所有内容,据我所知,这就是我需要做的所有事情:

self.inviteContent = [[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:@"http://mywebsite.com"]];
[FBSDKAppInviteDialog showWithContent:self.inviteContent delegate:self];

在 mywebsite.com 上,我在标题中有这个(此处显示的示例值):
<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 应用程序。我写了一条消息并选择了我想向其发送邀请的人,点击发送,我收到此错误:
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.

我究竟做错了什么?

我的应用程序可以很好地处理自定义 URL,因为如果我在 Mobile Safari 中输入 appurl://action 它会打开我的应用程序。

最佳答案

您需要创建一个 AppLink URL from here/

  • 从列表中选择您的应用程序
  • 用等效信息填写表格
  • 点击下一步!
  • 大功告成。

  • 现在,您可以将该链接与您的邀请代码一起使用。
    self.inviteContent = [[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:APP_LINK_HERE]];
    [FBSDKAppInviteDialog showWithContent:self.inviteContent delegate:self];
    

    该链接的格式类似于 https://fb.me/xxxxxxxxxxxxxxxx
    所有 x 将被数字替换。

    关于ios - Facebook App Invites iOS v4 SDK 错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29402465/

    10-09 20:08
    查看更多