[英]Facebook FB.ui send method not working on mobile web and need alternative
我試圖讓我的應用程序的用戶通知多個Facebook好友,他們需要他們在網頁上投票選出他們喜歡的項目。 我一直在使用FB發送方法( https://developers.facebook.com/docs/reference/dialogs/send/ )並且它在桌面上工作正常( 代碼如下 )但我只是意識到我忽略了它在哪里在文檔中說這個對話框“在移動設備上不受支持”。
是否有任何替代發送方法,允許用戶從移動瀏覽器向他們的朋友發送私人消息? 也許是一種誘騙api認為它是桌面的方法?
我也願意使用另一個FB對話框,只要它:1)從移動瀏覽器起作用2)允許預先填充收件人3)在發件人和收件人之間是私密的,例如私人消息或通知。
任何想法將不勝感激。 謝謝
FB發送方法代碼:
function resetSelector(){
$('#fs-user-list').empty();
$(".mutual-friends-link").fSelector({
max: 5,
excludeIds: exclusions,
facebookInvite: false,
lang: {
title: "Pick your mutual friends who will vote on the gifts (Last step)",
buttonSubmit: "Add Accomplices",
selectedLimitResult: "Limit is {5} people."
},
closeOnSubmit: true,
onSubmit: function(response){
var accompliceUid;
accomplices = response;
$('#index-accomplices').empty()
var i = 0
var FB_notification = function(accomplice, poll_id){
FB.api('https://graph.facebook.com/', 'post', {
id: "http://giftadvisor.herokuapp.com/polls/" + poll_id,
scrape: true
}, function(response){
FB.ui({
method: 'send',
to: [accomplice],
link: "http://giftadvisor.herokuapp.com/polls/" + poll_id,
}, fbCallback)
})
}
var fbCallback = function(){
console.log(i++)
if (i === accomplices.length){
window.location = "/polls/" + poll.id
}
}
_.each(accomplices, function(accomplice){
$('#index-accomplices').append('<img class="accomplices" src="http://graph.facebook.com/' + accomplice + '/picture?type=large">');
user = new User({uid: accomplice});
user.save(null,
{success: function(response){
console.log("users saved")
console.log(response.attributes.uid);
vote = new Vote();
vote.save({
user_id: response.attributes.id,
poll_id: poll.id,
image_url: "http://graph.facebook.com/" + response.attributes.uid + "/picture"
},{success: function(response){
FB_notification(accomplice, poll.id);
}
}
);
}});
});
// }});
},
onClose: function(){
// FB_notification(accomplices, poll.id);
}
}); }
我唯一看到的就是使用現已棄用的聊天API。 例如, 看看Grouper的作用 。
發送對話框確實是我想要的,但移動網絡上的失敗使它變得毫無用處。 您是否找到了可行的其他方法?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.