Facebook API-如何邀请用户分组? [英] Facebook API - How to invite user to group?

查看:152
本文介绍了Facebook API-如何邀请用户分组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的应用,尝试使用facebook api邀请用户加入群组.

I create a simple app to try invite a user to a group using facebook api.

这是我的html:

<form action="testinvite.php" method="post">
    <input type="text" name="ids" id="aidi"/>
    <button type="submit">submit</button>
</form>

testinvite.php

include("facebookdata.php");
   $id = $_POST['ids'];
   if($id){
     try{
         $facebook->api('/436048536430488/members/'. $id .'/','post');
        }
     catch(FacebookApiException $e) 
     {
       echo "error";
     }
  }

它永远不会成功.有人可以帮助我吗?非常感谢

It never success. Anyone can help me? Thank you very much

推荐答案

根据facebook文档-

According to the facebook documentation-

被邀请的用户必须是该应用程序的用户.此外,用户只能被邀请一次.后续邀请将失败.

User being invited must be a user of the application. Also, users can only be invited once. Subsequent invites will fail.

这是仅有的两件事,我认为您的代码(以及问题中提供的信息量)可能会出错.

These two are the only things, that I think could go wrong with your code (and with the amount of information provided in the question).

来源:图形API-组参考.

这篇关于Facebook API-如何邀请用户分组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆