Facebook dialog Error

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

Hello developers,

I want to have a share option for facebook in my iphone app. I am trying to accomplish this with titanium developer 1.0.4. So far I can log in on facebook using my facebook username and password. After that I want to share something through a wall post. Therefor I use the Titanium.Facebook.dialog option.

(After I logged in) I open the dialog and get an error in the dialog that says : "Sorry something went wrong." I used the titanium example from here. I also looked into the kitchensink example and I got the same problem there. I don't know if facebook itself is the problem here but I don't get it to work.

When I try to post something with Titanium.Facebook.requestWithGraphPath I don't get any errors and my message is posted on my facebook wall.

Here is my code :

var win = Ti.UI.currentWindow;
//app id and permissions
Titanium.Facebook.appid = "12345";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
 
var shareButton = Ti.UI.createView({
    width:30,
    height:20,
    top:0,
    backgroundColor:'#fff',
    borderColor:'#fff'
});
 
var dialog = Titanium.UI.createOptionDialog({
    title: 'Share sailing',
    options: ['Facebook', 'Log out', 'Cancel'],
    destructive: 2
});
 
shareButton.addEventListener('click', function(e){
    dialog.show();
});
 
dialog.addEventListener('click', function(e) {
    // when i click the facebook button
    if(e.index == 0) {
        if (!Ti.Facebook.loggedIn) {
            Ti.Facebook.authorize();
            Ti.API.info('Facebook authorize fired.')
        }
        else {
            openFacebookDialog();
        }
    }
    else if (e.index == 1) {
        if (Ti.Facebook.loggedIn) {
            Ti.Facebook.logout();
            alert('Logged out from facebook');
        }
        else if (!Ti.Facebook.loggedIn) {
            alert('You are already logged out from facebook');
        }
    }
});
 
Titanium.Facebook.addEventListener('login', function(e) {
    if (Ti.Facebook.loggedIn){
        openFacebookDialog();
    }
});
 
function openFacebookDialog(){
    var data = {
    link: "http://www.appcelerator.com",
    name: "Appcelerator Titanium Mobile",
    message: "Checkout this cool open source project for creating mobile apps",
    caption: "Appcelerator Titanium Mobile",
    picture: "http://developer.appcelerator.com/assets/img/DEV_titmobile_image.png",
    description: "You've got the ideas, now you've got the power. Titanium translates your hard won web skills into native applications..."
    };
 
    Titanium.Facebook.dialog('feed', data, function(e) {
        if (e.success) {
            alert(e.result);
        } else if (e.error) {
            alert(e.error);
        } else {
            alert('Unknown response'); //After i close the dialog the alert Unknown response opens.
        }
    });
}
 
win.add(shareButton);
I hope someone can give an answer to this problem.

regards,

Tim

— asked 2 years ago by cant delete
1 Comment
  • I am using Titanium mobile sdk 1.7.2

    — commented 2 years ago by cant delete

5 Answers

good news it's fixed now as from yesterday. just go to http://builds.appcelerator.com.s3.amazonaws.com/index.html select the master branch, copy the v1.8 link, then open Titanium Studio, go to help -> install Titanium SDK from URL, paste the url you just copied. recompile and you are done.

exactly same problem here. any ideas for a quick fix? i cant´ wait until facebook fix this, my app is on the appStore, and the whole thing it relies on this function. Since saturday 1st of october all the facebook functionality have been ropey as hell.

Does anyone know how to fix it? I used http://developer.appcelerator.com/apidoc/mobile/1.7.1/Titanium.Facebook-module and already upgraded the latest Titanium SDK for iOS but it still has a problem when I didn't put any message and share on my wall on the facebook dialog and it shows that the operation could not be completed NSURLErrorDomain Code=-999 and it crash but if I put some message, it works fine.

Same problem for me, with the latest titanium sdk (1.7.2).

I think it is caused by some recent facebook changes that are incompatible with titanium, because in all my applications the facebook plugin stopped working. I hope it will get fixed soon because some of them are already published on the app store...

KitchenSink is broken as well. Works like a charm on Android, though.

— answered 2 years ago by Anders Pedersen
answer permalink
2 Comments
  • It is also not working for android for me :/

    — commented 2 years ago by cant delete

  • I got it working on android now, but on the iphone it is still broken.

    — commented 2 years ago by cant delete

Your Answer

Think you can help? Login to answer this question!