Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook apprequests dialog always returns cancelled Titanium Android?

I'm using facebook 3.0.1 titanium module. In Android, the Facebook apprequests dialog always returns as cancelled, even while the actual apprequest is send as can be seen on Facebook. Because of this I cannot store the requestid in my back-end, which makes the apprequest useless.

But in iOS it works fine.

This is my code

var fb = require('facebook');
fb.appid = 'my_app_id';
fb.permissions = ['publish_stream', 'read_stream', 'email']; // Permissions your app needs
fb.forceDialogAuth = true;

fb.addEventListener('login', function(evt) {
    if (evt.success) {
            fb.dialog("apprequests", {
              message:"LeaugeNation",
              // max_recipients : "2"
            }, function(response) {   
                alert(JSON.stringify(response));
                if(response.result) {
                        alert("send friend req");
                        // sendFacebookInvite(e.result);                                    
                    }    
            });

    } else if (evt.error) {
        alert("error");
    } else if (evt.cancelled) {
        alert("cancelled");

    } else {
            alert("default");
    }
});

fb.authorize();

If i run the code i'm getting the following result

{"cancelled":true,"code":-1,"success":false}

I made the following changes, but did't got the result.

  • changed the appid won't change result
  • changed the Key Hash for that Facebook App

Thanks in advance.

Can you please tell me what change, that i want to made to get the correct result in Android.

like image 887
user3222887 Avatar asked Jan 22 '14 10:01

user3222887


1 Answers

You must look to facebook setting. did you register Your activity and allow the permission from developers site which you are using here. Also If you are not exporting your app please export properly with proper keystore.

like image 95
MrDumb Avatar answered Oct 24 '22 08:10

MrDumb