**嗨,我正在尝试向用户的 30 个随机朋友发送应用请求。所以我想获取 30 个 facebook 朋友的用户 id 解析它并将 uid 输入
function sendRequestToRecipients() {
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
message: 'sample message',
to: 'id of friend1,id of friend2,id of friend 3,,,,,,,'
}, requestCallback);
}**
以下是完整的示例代码...
<script>
FB.init({
appId : 'appid',
frictionlessRequests: true,
});
我们必须把朋友的身份证放在这里.....
function sendRequestToRecipients() {
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
message: 'sample message',
to: 'id of friend,id of friend'
}, requestCallback);
}
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'sample message'
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
</script>