在来自 Facebook API 的状态更新中标记朋友

Tagging friends in status updates from Facebook API(在来自 Facebook API 的状态更新中标记朋友)
本文介绍了在来自 Facebook API 的状态更新中标记朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我最近遇到了 这篇博文 说可以在来自 Facebook 应用(=来自 API)的状态更新中标记某人:

但是,它似乎对我不起作用.

它尝试了三种不同的方式:

$post = $facebook->api('/me/feed', 'post', array('access_token' =>$session['access_token'],'消息' =>你好@[562372646:Lionel Cordier],你好吗?"));

$access_token = $session['access_token'];$message = '你好@[562372646:Lionel Cordier],你好吗?';$curl_post = 'access_token='.$access_token.'&message='.$message;$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/me/feed');curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);$data = curl_exec($ch);curl_close($ch);

$access_token = $session['access_token'];$message = '你好@[562372646:Lionel Cordier],你好吗?';$curl_post = 'access_token='.$access_token.'&status='.$message;$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://api.facebook.com/method/users.setStatus');curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);$data = curl_exec($ch);curl_close($ch);

但没有任何效果.我的结果是Hello @[562372646:Lionel Cordier],你好吗?"在我的墙上.

但如果我直接在 Facebook 中输入Hello @[562372646:Lionel Cordier],你好吗?",它就可以正常工作.

我做错了什么?

解决方案

上周我一直在努力解决这个问题,并发现了以下错误报告,它表明(鉴于当前的 ASSIGNED 状态)还无法完成:(

http://developers.facebook.com/bugs/395975667115722/>

I recently came across this blog post that said that it's possible to tag someone in a status update from a Facebook app (= from the API):

However, it doesn't seem to work for me.

It tried it in three different ways:

$post = $facebook->api('/me/feed', 'post', array(
    'access_token' => $session['access_token'],
    'message' => 'Hello @[562372646:Lionel Cordier], how are you?'
));

or

$access_token = $session['access_token'];
$message = 'Hello @[562372646:Lionel Cordier], how are you?';
$curl_post = 'access_token='.$access_token.'&message='.$message;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/me/feed');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);
$data = curl_exec($ch);
curl_close($ch);

or

$access_token = $session['access_token'];
$message = 'Hello @[562372646:Lionel Cordier], how are you?';
$curl_post = 'access_token='.$access_token.'&status='.$message;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.facebook.com/method/users.setStatus');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);
$data = curl_exec($ch);
curl_close($ch);

But nothing works. The result I have is "Hello @[562372646:Lionel Cordier], how are you?" on my wall.

But if I type "Hello @[562372646:Lionel Cordier], how are you?" directly in Facebook, it works correctly.

What am I doing wrong?

解决方案

I was struggling with this problem last week and found the following bug report, which suggests (given the current ASSIGNED status) that it cannot be done yet:(

http://developers.facebook.com/bugs/395975667115722/

这篇关于在来自 Facebook API 的状态更新中标记朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)