facebook comment not posted even when it gives a success message.

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

Hi all. Somehow I cannot make this code work. I am trying to post a comment to a facebook page (fan page) from the app, but nothing really happens. I am logged in and it gives me the success message without posting anything. What am I doing wrong? I have tried the same code just putting in a fixed message (not from the text field), and it still doesn't post the message.... Thanks for your help!

var comments = Ti.UI.createTextField({
    height:35,
    top:10,
    left:10,
    width:250,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
    });
 
var submitButton = Ti.UI.createButton ({
        width:50,
        height:35,
        top:10,
        right:5,
        title:'submit'
    });
 
submitButton.addEventListener('click', function(e) {
Ti.Facebook.permissions = ['publish_stream'];
Ti.Facebook.authorize();
var page_id = '326047330755956';
Ti.Facebook.requestWithGraphPath(page_id + '/feed', {message: comments.index}, "POST", function(e) {
    if (e.success) {
        alert("Thanks!");
    };
 
});
Dearest Louise

1 Answer

Looks like you are doing everything right. Some Titanium modules are a little weird so when you post a question you should include which version Titanium you are running.

I would preform a full rebuild of your build directory. Go to your app directory and remove everything from inside the build folder. Then rebuild your app from Titanium.

Your Answer

Think you can help? Login to answer this question!