$ facebook-> api回调函数? [英] $facebook->api callback function?

查看:109
本文介绍了$ facebook-> api回调函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我使用PHP SDK完成FB api调用后可以调用的回调函数吗?

anyone know of a callback function I can call after I have done a FB api call using the PHP SDK?

如果没有,是否可以通过某种方法将其构建到SDK中?

If not, is there some way I can build one into the SDK?

先谢谢!

推荐答案

这不是必需的,因为通过PHP SDK对Facebook Graph API的所有调用都是同步的.因此,可以在调用API之后直接调用任何函数,请考虑以下示例:

This isn't necessary, as all calls to the Facebook Graph API via the PHP SDK are synchronous. Therefore you can call any function directly after the call to the API, consider this example:

<?php

try {
    $result = $facebook->api("/me");
    do_something($result);
} catch (Exception $e) {
    // Log Error
}

PHP-SDK也是开源的,因此您也可以对其进行派生,实现功能并通过更改将请求提交给Github.您可以在 https://github.com/facebook/php-sdk 中找到源.

Also the PHP-SDK is Open Source, so you could also fork it, implement your feature and file a Pull Request on Github with your changes. You can find the Source at https://github.com/facebook/php-sdk.

这篇关于$ facebook-&gt; api回调函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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