2
突然問題,我們有一個iframe的facebookapp,直到昨天工作正常。儘管我們沒有更改任何應用程序突然停止工作。Facebook的PHP API - 與users_isAppUser()
我們可以將users_isAppUser()
識別爲問題。該方法返回用戶沒有添加應用程序,雖然他肯定已經安裝了應用程序並已登錄。我們可以刪除try/catch部分(請參閱下面的代碼),以便應用程序不會在重定向循環中被捕獲,但下面的方法不起作用或者:
$this->facebook->api_client->friends_get()
$this->facebook->api_client->friends_getAppUsers()
$this->facebook->api_client->call_method('facebook.users.hasAppPermission', array('ext_perm' => 'publish_stream'))
require_login()
做的工作,我們可以得到登錄用戶的facebook的用戶ID。
奇怪的是,我們的應用程序一直工作到幾個星期,直到昨天。 在過去的幾天裏,API有沒有任何祕密的改變?或者其他的結論是什麼問題可能是什麼? 我會很感激任何提示。提前致謝!
$this->fbuserid = $this->facebook->require_login();
// check if user has added app, exception gets thrown if the cookie has an invalid session_key i.e. user is not logged in
try {
if(!$this->facebook->api_client->users_isAppUser()) {
$this->facebook->redirect($this->facebook->get_add_url());
}
} catch (exception $ex) {
// clear cookies for application and redirect to login prompt
$this->facebook->set_user(null, null);
$this->facebook->redirect($this->configArray['appcallbackurl']);
}
這是[Facebook的示例代碼(http://developers.facebook.com/docs/guides/web/)。請不要複製和粘貼沒有歸屬。 – 2011-05-07 07:42:24
好..巴迪.....謝謝你指導我..我添加屬性它 – Partyboy 2011-05-07 07:45:06
如果這些是你的真正的關鍵,請注意,你的答案的所有版本都保存(點擊「編輯....前」鏈接以上)並公開可見。如果你需要他們完全消失,請舉報主持人的注意並要求他們刪除第一次修訂。對於您的其他答案,密鑰和祕密都是可見的 – 2011-05-07 07:49:01