以下代码:
//set permissions for graph api
var permissions = ['user_friends','user_birthday','user_photos','basic_info'];
var facebookModule = facebookHelper.FacebookConnection(permissions);
//event handler to listen to user when they have logged in
facebookModule.addEventListener('login', function(e){
if(e.success){
//before setting model we want to see if data exists already in database
alert('You were Logged in');
//get me data upon success
facebookModule.requestWithGraphPath('me', {}, 'GET', function(e) {
if (e.success) {
console.log(e.result);
} else if (e.error) {
alert(e.error);
} else {
alert('Unknown response');
}
});
它返回一个不完整的JSON对象。