Cannot add/search friends using ACS. Please help!

You must Login before you can answer or comment on any questions.

Hello,

I am running latest SDK for iOS.

I am trying to use ACS but it seems there are a lot of bugs. I can for example add a friend but when I search for my friends I get 0 friends in return.

This is the code I use to add a friend to the current user:

Cloud.Friends.add ({
 
    user_ids: e.rowData.id,
 
    approval_required: false
 
}, function(e) {
 
    if (e.success) {
 
        alert('Friend(s) added');
 
    } else {
 
        alert(e.message);
 
    }
 
});
This is the code I use to find the friends belonging to the current user:
Cloud.Friends.search ({
 
    user_id: Ti.App.Properties.getString('user_id')
 
}, function (e) {
 
            if (e.success) {
 
 
            }
 
});
Please I am going nuts about this ACS it is not working in many parts. Like this and custom sizes for photo uploads. Why can´t I manage friend connection in the app backend like all other parts of ACS?

1 Answer

Hi Daniel,

I looked at your app. If you simply use add friend withiout specifying approval_required=false, a friend is not automoatically added until the request is approved.

Please check out the following doc link to find more information. By default add friend requires approal requirement

http://cloud.appcelerator.com/docs/api/v1/friends/add

We will add friend connections to ACS management console soon.

Wei

— answered 10 months ago by Wei Kong
answer permalink
2 Comments
  • I have tried with approval_required=false too unfortunately (in Ti Studio with Ti.Cloud module).

    — commented 10 months ago by Daniel Krusenstråhle

  • turned out it should have single quote around false

    Cloud.Friends.add ({ user_ids:e.rowData.id, approval_required: 'false' }

    — commented 10 months ago by Wei Kong

Your Answer

Think you can help? Login to answer this question!