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

Cloud.Likes.create does not work. Returns is not and object (undefined)

$
0
0

I am trying to add a like to an existing post that I have by using the following method.

favorite.addEventListener('click', function(){
    Cloud.Likes.create({
        post_id: itemID
    }, function (e) {
        if (e.success) {
            var like = e.likes[0];
            alert('Success:\n' + 'id: ' + like.id + '\n');
        } else {
            alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
        }
    });
});
I see that this requires the user to login. I have that already set up in my app.js file. Once the user logs in, they are taken to a different screen where they can see a bunch of posts in a table. Clicking on a row loads more information about that post from ACS.

I have a created a button that should add a "like" to the current post. Everything else works fine except for creating the like on the post.

  • I have cleaned my project several times.
  • I am currently running 3.2.0.201311262027
  • Tested on iPhone 5S 7.0.4

Viewing all articles
Browse latest Browse all 8068

Trending Articles