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

ACS one way follow friend request not working??

$
0
0

So I'm trying to setup my app with following and followers like twitter... My issue is its not accepting the friend request as a one way follow/follower request like it should. I have my friend request type as one way on the ACS settings dashboard and and have done my follow request as such:

Cloud.Friends.add({
        user_ids : userInfo.user.id,
        approval_required : false
        }, function(e) {
            if (e.success) {
                alert('Friend(s) added' );
                Ti.API.info("Freinds returned" + JSON.stringify(e));
            } else {
                alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
            }
        });
It adds the user to the pending list... which if you put approval_required : false thats not supposed to happen right?

Then I figured I would just do a query to see if its coming up as a following instead of pending but I can't seem to figure out the friend query method. Its saying to try the send request method and the curl command but I'm having no luck on this. What am i doing wrong here?

Here is the curl command

curl -b cookies.txt -c cookies.txt  -X GET --data-urlencode "followers=true" "https://api.cloud.appcelerator.com/v1/friends/query.json?key=<APP_API_KEY>&pretty_json=true"

here is the send request command

Cloud.sendRequest({
    url : "users/login.json",
    method : "POST",
    data : {
        login : 'test@mycompany.com',
        password : 'test_password'
    }
}, function(e) {// The callback called when the request completes
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' + 
            'id: ' + user.id + '\n' + 
            'sessionId: ' + Cloud.sessionId + '\n' + 
            'first name: ' + user.first_name + '\n' + 
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
    }
});
Heres what Ive been trying
Cloud.sendRequest({
    url : "https://api.cloud.appcelerator.com/v1/friends/query.json?key=<mykeyhere>&pretty_json=true",
    method : "GET",
    data : {
        followers:true
    }
}, function(e) {// The callback called when the request completes
    if (e.success) {
        alert(JSON.stringify(e));
    } 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>