donglun4521 2012-03-09 12:51
浏览 36
已采纳

邀请朋友使用PHP列表来使用app

I wish to manage the friends invitations to use a facebook app, in PHP.

But I can't find a good answer, because I don't wish to display those facebook dialog box !

First : Is it possible to do it in PHP, without displaying the facebook dialog box ?

I get the friends list with the following (user is already connected/allowed the app)

include("../config/fb_config.php");

$facebook = new Facebook(array(
  'appId'  => $fbconfig['appid'],
  'secret' => $fbconfig['secret'],
  'cookie' => true,
));

$friends = $facebook->api('me/friends');

foreach($friends['data'] as $users)
{   
    echo "<input type=\"checkbox\" name=\"".$users['id']."\"/> 
             ".$users['name']."<br/>";
}

Is there any facebook url/method to send the invite requests, with checked ids and a message ?

Or something like the "publish a message on the user wall"

$facebook->api('/me/feed', 'post', array('message'=>'blabla...');

  • 写回答

1条回答 默认 最新

  • dsk920417 2012-03-09 13:45
    关注

    You are unable to do it without providing the popup box. Simply put Facebook makes sure on most occasions the user is in control of what they are doing, unless they give explicit permissions for an app to do so. And there is no permission for what you are trying to do.

    The closest you will get is Frictionless Requests. As linked to in your question: https://developers.facebook.com/docs/reference/dialogs/requests/. But it looks like they need to confirm at least once. After that you can send requests without a popup dialog.

    However this is only supported via the Javascript SDK and not PHP.

    I am afraid at this time, it is the best you have.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 vscode的问题提问
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM