I cant call method() inside FB.api. how can I access method? cant do it this.method(); or method();
var MyLayer = cc.Layer.extend({
init: function(){
FB.init({
............
});
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
FB.api('/me', function(response) {
this.method(); // <---- I cant call this here. How can I call method(); ?? Thank!
});
}
});
},
method: function(){
alert("Hello");
}
});