Angularjs 不支持重定向uri:ionic和satellizer的facebook身份验证

Angularjs 不支持重定向uri:ionic和satellizer的facebook身份验证,angularjs,ionic,satellizer,Angularjs,Ionic,Satellizer,我正在我的ionic应用程序中使用卫星库进行facebook身份验证 在开发过程中(在浏览器中完成)。。卫星导航器fb对象配置为: $authProvider.facebook({ clientId: AppConstants.facebook.clientId, scope: 'user_friends', url: 'http://localhost:3000/auth/facebook' }); 这个很好用。但是,当我在emulator中运行应用程序时,我收到以下错误: Th

我正在我的ionic应用程序中使用卫星库进行facebook身份验证

在开发过程中(在浏览器中完成)。。卫星导航器fb对象配置为:

$authProvider.facebook({
  clientId: AppConstants.facebook.clientId,
  scope: 'user_friends',
  url: 'http://localhost:3000/auth/facebook'
});
这个很好用。但是,当我在emulator中运行应用程序时,我收到以下错误:

The redirect_uri is not supported

如何解决这个问题?

问题是,当你使用模拟器(或手机)时,默认的重定向URI变成了Facebook不允许的
文件://
。将其更改为类似
http://localhost/
并将其添加到Facebook开发控制台中允许的重定向uri中

默认配置:
redirectUri:window.location.origin+'/'

改为:
redirectUri:'http://localhost/“

因此,您的设置将如下所示:

$authProvider.facebook({
  clientId: AppConstants.facebook.clientId,
  scope: 'user_friends',
  url: 'http://localhost:3000/auth/facebook', 
  redirectUri: 'http://localhost/'
});