How to use Facebook token obtained through Firebase authentication appropriately?

做~自己de王妃 提交于 2019-12-06 07:40:42

Starting with Firebase 4.0.0, additional IdP data will be directly returned in the result of type UserCredential. You shouldn't need to make an additional API call to Facebook to get data like first/last name:

firebase.auth().getRedirectResult().then(function(result) {
  if (result.user) {
   // Additional user info like first name, last name,
   // Facebook account url, gender, etc.
   console.log(result.additionalUserInfo.profile);
   // Facebook access token returned in the process
   // for the scopes requested.
   console.log(result.credential.accessToken);
 }

});

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!