本文整理匯總了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);
})
}