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.
Your Answer
Think you can help? Login to answer this question!