我想将 App req 发送给 5 个人,我已经设法获得了 5 个人的 UserID,但它总是相同的 5 个人,有没有办法随机化USERID's
我从 Facebook 获得的?
<script>
var profilePicsDiv = document.getElementById('profile_pics');
FB.getLoginStatus(function(response) {
FB.api({ method: 'friends.get' }, function(result) {
Log.info('friends.get response', result);
var user_ids="" ;
var numFriends = result ? Math.min(5, result.length) : 0;
if (numFriends > 0) {
for (var i=0; i<numFriends; i++) {
user_ids+= (
',' + result[i]
);
}
}
profilePicsDiv.innerHTML = user_ids;
alert(user_ids);
});
});
function sendRequestToRecipients() {
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
message: 'My Great Request',
to: user_ids, /// How to Fill the ID's HERE ?
}, requestCallback);
}
</script>