[英]Facebook apprequest not being sent to facebook users
我正在開發一個與facebook集成的網絡應用程序,我正在使用請求對話框來邀請新用戶。 因此,我的應用程序的用戶可以單擊一個按鈕,將請求發送給尚未成為用戶的他的某些Facebook朋友。
exports = fm.namespace(this,'bla','facebook')
exports['init'] = function(){
window.fbAsyncInit = function() {
if (undefined !=RAILS_ENV['facebook_app_id'])
{FB.init({
appId : RAILS_ENV['facebook_app_id'], // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});}
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
}
exports['sendRequestToOneRecipient']= function (uid) {
FB.ui({method: 'apprequests',
message: "bla bla",
to: uid
}, requestCallback);
function requestCallback(response) {
if (response && response.to) {
console.log("Message was sended");
} else {
console.log("Message was not sended.");
}
}
}
據我所知,它不需要任何權限,因為它是來自用戶的明確操作。 當用戶單擊該按鈕時,將顯示Facebook窗口,一切正常。 回調是發送回appId和destinatary的用戶ID,但該消息永遠不會在facebook destinatary帳戶中被通知
控制台上沒有JavaScript錯誤
我發布在Facebook朋友的牆上,它沒有任何問題。 相同的代碼,但不是'apprequest',方法是'feed'
為了解決該問題,我剛剛將我的應用程序標記為facebook應用程序,並添加了畫布安全URL,因此當用戶收到我的請求時,可以將其重定向到有效站點。 一旦我添加了該url,用戶就會收到所有通知。
現在的問題是,我必須創建一個特定的頁面來嵌入iframe,因為我的網站看起來不像iframe。 此外,我必須獲得ssl證書,因為canvas url必須是https。 如果有人知道解決方法,請告訴我。
謝謝你的幫助
將以下內容放入模板文件:
if (top.location != self.location)
{
top.location = self.location
}
如果您所在的主要網站的位置與您網站的位置不同,則會將您重定向到您的網站。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.