邀请朋友用facebook sdk错误

时间:2016-02-11 12:35:54

标签: android facebook facebook-invite-friends

我按照facebook文档邀请我的朋友 我的应用程序有两个平台(android& ios),我想邀请我的朋友安装应用程序但是当发现这个错误时

enter image description here

所以我有两个平台,所以我在我自己的服务器中创建了html文件并通过它(首先用android平台测试然后我将添加ios链接)

   <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"    
    xmlns:fb="https://www.facebook.com/2008/fbml"><head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>my app </title>


 <meta property="al:android:urlcontent="https://fb.me/1047369566223853">
<meta property="al:android:app_name" content="myapp">
<meta property="al:android:package" content="com.myapp.android">

<meta property="og:title" content="myapp">
<meta property="og:type" content="website">
<meta property="fb:app_id" content="9935316166414594">
<meta property="og:image   
  content="http://myimage.jpg">

 <body>
 </body></html> 

这是facebook文档

    <html>
  <head>
  <meta property="al:ios:url" content="couchinapp://invite_from_fb?  
   referral=123456789" />
   <meta property="al:ios:app_store_id" content="123456789" />
   <meta property="al:ios:app_name" content="Couchin'" />
  <meta property="al:android:url" content="couchinapp://invite_from_fb?  
  referral=123456789" />
  <meta property="al:android:app_name" content="Couchin" />
  <meta property="al:android:package" content="com.mycompany.couchin" />
  <meta property="al:web:url" content="http://www.couchinapp.com/myapp.html"   
 />
</head>
<body>
Couchin App Link
</body>
  </html>

在我使用的java代码中

 String appLinkUrl= myserverip/folder/myhtmlfile.html

//myhtmlfile which contains links on my server
    AppInviteContent content = new AppInviteContent.Builder()
            .setApplinkUrl(appLinkUrl)
            .setPreviewImageUrl(previewImageUrl)
            .build();
    AppInviteDialog.show(InviteFacebookFriends.this, content);
    this.finish();

1 个答案:

答案 0 :(得分:0)

AppLink不是您应用的网址,但它是指向您应用内的内容的网址。

&#xA;&#xA;

您似乎没有使用正确的 AppLink URL。请验证您的 AppLink

&#xA;&#xA;

如果你还没有URL,你可以创建此处

&#xA;