本文整理汇总了TypeScript中ionic-native.Facebook.api方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Facebook.api方法的具体用法?TypeScript Facebook.api怎么用?TypeScript Facebook.api使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-native.Facebook
的用法示例。
在下文中一共展示了Facebook.api方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
(response: FacebookLoginResponse) => {
Facebook.api('/me?fields=email', ['email', 'public_profile']).then((response) => {
console.log(response);
self.dataProviderService.login(response).subscribe(res => {
var user = res.json();
self.login(user, user.isNew);
});
});
},
示例2: fbMe
fbMe(response) {
Facebook.api(
"/me?fields=" + this.iframewin.apppfb.me_fields,
null
).then( response => {
this.fetchUser_Callback(response);
});
}
示例3: getFacebokInfo
getFacebokInfo(userID) {
//this.loginSuccess();
Facebook.api(userID + "/?fields=id,email,birthday,picture,name,gender", ["public_profile", "email"]).then((result) => {
this.global.member.id = userID;
this.global.member.type = 'facebook';
this.global.member.email = result.email;
this.global.member.birthday = result.birthday;
this.global.member.picture = 'http://graph.facebook.com/' + userID + '/picture?type=square';
this.global.member.name = result.name;
this.global.member.gender = result.gender;
//this.test = 'result : ' + JSON.stringify(result);
try {
//let storage = new Storage(SqlStorage);
this.global.storage.set('member', JSON.stringify(this.global.member)).then(() => {
this.loginSuccess();
});
} catch (e) {
alert(e.message);
}
}, function (error) {
this.test = 'error : ' + error;
})
}
示例4: getProfile
getProfile(){
Facebook.api('/me?fields=id,name,picture',['public_profile']).then(
(response)=> {
this._dataservice.fbid=response.id;
this._dataservice.username=response.name;
this._dataservice.picture=response.picture.data.url;
this.loading.dismiss();
this.menu.enable(true);
this.nav.setRoot(HomePage);
},
(err)=>{
let alert = Alert.create({
title : "Couldn't get your info",
subTitle : "You can't continue right now, Try again later",
buttons:['Will check it out']
});
this.loading.dismiss();
this.nav.present(alert);
}
);
}
示例5: getFriends
static getFriends(user, successCallback) {
Facebook.api('me/friends?access_token=' + user.token, []).then(response => {
let friends = response.data;
successCallback(friends);
})
}
示例6:
}).then((res)=> {
return Facebook.api('/me?fields=first_name,last_name,birthday,gender,email,picture', [])
})
示例7: getUser
getUser(user,successCallback){
Facebook.api('me/photos?acess_token=' + user.token,[]).then( response => {
let photo = response.data;
successCallback(photo);
})
}