离子/云角FacebookAuth给出空错误 [英] Ionic/cloud-angular FacebookAuth gives empty error

查看:167
本文介绍了离子/云角FacebookAuth给出空错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中添加了离子云服务,并希望使用本机的FaceBook验证。

I've added ionic cloud services to my app and want to use the native FaceBook authentication.

import { FacebookAuth } from '@ionic/cloud-angular';

this.facebookAuth.login()

当运行此功能时Android手机,正如预期的那样,我得到Facebook的提示,询问我的应用程序是否可以获得阅读个人资料和电子邮件的权限当我单击YES,该函数返回一个空的ERROR对象:

When running this function on an Android phone, as expected I get the Facebook prompt to ask if my app can get permissions to read profile and email. When I click YES, the function returns an empty ERROR object:

Object {}

我确定我正在抓住它,因为当我在FB提示符下选择CANCEL时,我收到这个错误对象:

I'm sure I am catching it right, because when I choose CANCEL on the FB prompt, I get this error object:

Object {errorCode: "4201", errorMessage: "User cancelled dialog"}

注意:我在Chrome中使用远程Web检查器来查看完整的控制台。不幸的是,由于这需要一个真正的设备,我不能Plunker这个。但是,我希望有人有一个想法为什么会发生这种情况。我遵循了所有这些步骤,包括FB开发者设置,哈希和ion.io设置。

Note: I'm using remote web inspector in chrome to see the full console. Unfortunately, as this requires a real device I can not Plunker this. However, I hope someone has an idea why this could happen. I have followed all these steps, including the FB developer settings, the hash and the ionic.io settings.

推荐答案

确实很愚蠢,但第一个根本原因是FB用户是试图登录并没有注册为测试人员。显然,在这种情况下,插件返回一个空的错误。

Ok it's quite silly, but the first root cause was that the FB user I was trying to log in with was not registered as a tester. Apparently in that case, an empty error is returned by the plugin.

添加为测试者后,我收到了一个真正的错误(Andoird manifest不允许互联网访问)。解决这个问题后,再次出现一个空的错误。

After adding as a tester, I received a real error (Andoird manifest dod not allow internet access). After fixing that issue, again I'm getting an empty error.

所以我的假设是,FB返回的一些错误不是很好地被插件传递,所以任何其他FB错误都可能导致这个问题。

So my assumption is that some of the errors returned by FB are not well communicated by the plugin and so any other FB error can be causing this issue.

更新23/04:FB边似乎有一个变化,现在FB登录屏幕没有成功,但给了关于哈希键的错误。解决此问题后,FB登录现在正在工作。

UPDATE 23/04: There seems to be a change from FB side, now the FB login screen did not succeed but gave an error about the hashing key. After fixing that issue, the FB login is working now.

这篇关于离子/云角FacebookAuth给出空错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆