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