Ionic Facebook登录无法在浏览器中使用

时间:2019-03-16 07:10:47

标签: facebook ionic-framework cross-platform

我正在尝试使用我的应用程序中的Facebook插件对用户进行身份验证。

该应用程序在Android和IOS上均可正常运行,但在浏览器平台上却给我错误

Refused to display 'https://www.facebook.com/v2.7/dialog/oauth?app_id=123654321123456&channel_url=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2Fd_vbiawPdxB.js%3Fversion%3D44%23cb%3Df36f21b6784760c%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%253A8000%252Ff14b4ce45ced5a8%26relation%3Dopener&client_id=123654321123456&display=popup&domain=localhost&e2e=%7B%7D&fallback_redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fhome&locale=en_US&origin=1&redirect_uri=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2Fd_vbiawPdxB.js%3Fversion%3D44%23cb%3Df7d049bf5cf4a8%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%253A8000%252Ff14b4ce45ced5a8%26relation%3Dopener%26frame%3Df1f3c8729786114&response_type=token%2Csigned_request&scope=public_profile%2Cuser_photos%2Cemail%2Cuser_friends&sdk=joey&version=v2.7' in a frame because it set 'X-Frame-Options' to 'deny'.

为了理解我的问题,我提供了我正在使用的代码。

this.fb.login(['public_profile', 'user_photos', 'email','user_friends']).then((res: FacebookLoginResponse) => {
 let facebook_id = res.authResponse.userID;
 console.log(facebook_id)
 if(res.status == "connected") {
  //myActions 
 }
 else{
  //myActions
 }
});

我的编辑,我忘记上传问题图片,

enter image description here

0 个答案:

没有答案
相关问题