使用卫星的离子应用程序中的facebook身份验证

时间:2015-11-05 14:22:52

标签: facebook ionic

当创建需要facebook身份验证的普通angularjs应用程序时,我使用了卫星。

通常的流程如下:

1. Satellizer brings up facebook authentication window
2. Once authentication information has been entered, satellizer passes the "code" (or token) to the default callback url (which is http://localhost:3000/auth/facebook)
3. At this route, on the server, we query facebook for a long term token and then other details.

为了实现上述目标,我们在facebook-developer-portal中将应用程序设置为“web-application”。

对于我来说,这对于几个有角度的网络应用程序已经成功。

在开发离子应用程序时,我采用了相同的方法:

1. Create a web-app in facebook-developer-portal
2. Import satellizer and let satellizer call facebook authentication and pass the token to the callback url(ionic runs on http://localhost:8100 while the callback url is http://localhost:3000)
3. Get the long term token on the server and pass it back to the ionic-app

只要我在浏览器中开发离子应用程序,上述所有工作都会很好。

但是,当我在ios模拟器中构建并运行应用程序时,流程会中断。

在模拟器中运行时,应用程序会加载。然后卫星打开facebook认证窗口。输入身份验证信息后,它不会路由到另一个路由,而是返回登录页面。

也就是说应用程序不会显示除登录路由之外的任何其他路由,这只会因为该应用程序认为它未经过身份验证而发生。

我正在寻找两个问题的清晰度:

1. When running inside an emulator how and where to debug the app ?
2. When runnign insider the emulator, is this still a web-application.
    Does it still bear the adderss http://localhost:8100 ?

   if not, then should I set up this app as mobile-app in facebook developer console ? what other configuration needs to change ?

0 个答案:

没有答案