Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Adding friends without approval

$
0
0

Hi, I changed settings for friends to one-way and call the cloud service friend.add with approval_required set to false. But in the Manage Data website I can see that the friend request is still not approved and therefore the friend is not returned at a search. If I approve it manually the friend is returned at a search.

Cloud.Friends.add({
        user_ids: status.usersRanked[e.index],
        approval_required:false
    }, function (e) {
        if (e.success) {
            alert('Friend(s) added');
            session.queryFriends(function(){
                onGameStatus();
            });
        } else {
            alert('Error:\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });
exports.queryFriends=function(onFinished) {
    Cloud.Friends.search({
        user_id: exports.user_id,
    }, function (e) {
        if (e.success) {
            console.log('Success friends:\n' +
                'Count: ' + e.users.length + ' '+JSON.stringify(e.users));
            exports.friends=e.users;
            if (onFinished)
                onFinished();
        } else {
            alert('Error:\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });     
};

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>