Facebook dialog is not coming to share the text

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

Hi all,

I am trying the following code to share a text from Facebook dialog box , but the dialog is not coming . After successful login it goes to my account . I just want to share the text with the dialog box.

Titanium.Facebook.appid = "2502818253078703";
        Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
 
        button.addEventListener('click',function(){
 
            if(Titanium.Facebook.loggedIn)
            {
            //alert('send')
                send_facebook_stream();
            }
            else
            {
                Titanium.Facebook.authorize();
 
                Titanium.Facebook.addEventListener('login',function(e)
                {
                    Titanium.API.info('FACEBOOK LOGIN DATA'+e.data);
                    send_facebook_stream();
                });
 
            }
            /////
            function send_facebook_stream()
            {
                 var data = {
                     name:'Hello 1',
                         caption:"Dracula ?",
                     //description: myTextFieldInTitanium.value
             };
 
            //iter++;
 
    Titanium.Facebook.dialog("feed", data, showRequestResult);
 
 
    function showRequestResult(r)
    {
        //alert(r)
 
        if (r.result)
        {
            facebook_response = Ti.UI.createAlertDialog({
                        title:'Facebook Shared!',
                       message:'Your stream was published'
                       });
        }
        else
        {
            facebook_response = Ti.UI.createAlertDialog({
                           title:'Facebook Stream was cancelled',  
                           message:'Nothing was published.'
                         });
 
        }
        facebook_response.show();
        var fb_resp_timeout = setTimeout(function(){
            facebook_response.hide();
        }, 2000);
    }
 
    }
            /////
        });

— asked 11 months ago by mathew orleans
5 Comments
  • Hi Mathew,

    Have you set your facebook application id in your tiapp.xml file?.

    — commented 11 months ago by Nitin Chavda

  • Where to set in tiapp.xml file?? In my previous apps i didn't do anything in the tiapp.xml but they are working ...

    — commented 11 months ago by mathew orleans

  • Even outting the app id in tiapp.xml file didn't work.

    — commented 11 months ago by mathew orleans

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!