ACS Friend system won't work?

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

Hello. I am showing a list of all the users in my app. When the logged in user presses the user, it should Add him or her as a friend, but instead it is giving me this error:

message = "'undefined' is not an object (evaluating 'Cloud.Friends.add')";

And yes, I have included the require Cloud code, because I am using it for alot of other things in same file. Currently I am using this code to add friends:

table.addEventListener('click', function(e){
    Cloud.Friends.add({
        user_ids: checked.join(e.row.id)
    }, function (e) {
        if (e.success) {
            alert('Friend(s) added');
        } else {
            alert('Error:\\n' +
                ((e.error && e.message) || JSON.stringify(e)));
        }
    });   
  });

I have also tried to manually add an ID to the user_ids, like this:

user_ids: checked.join("5028de86002044626f0c8393")

1 Answer

Accepted Answer

what version of the ti.cloud.js are you currently using?

It is loaded similar to a module. If you are loading a version that does not include all the current calls, this can occur.

— answered 10 months ago by Stephen Feather
answer permalink
6 Comments
  • In my modules in tiapp.xml it says ti.cloud, and under the Apple icon it says 2.0.1. Isn't that the newest version?

    — commented 10 months ago by Nicolai Villadsen

  • 2.0.1 is dated back in April.

    — commented 9 months ago by Stephen Feather

  • Oh shoot, i just changed to 2.2.0 and it stopped giving me the error now. However it cant find the value "checked" in the checked.join(myid)

    — commented 9 months ago by Nicolai Villadsen

  • Show 3 more comments

Your Answer

Think you can help? Login to answer this question!