Firebase错误-来自此ios应用程序<empty>的请求被阻止

时间:2019-02-16 06:56:04

标签: ios api firebase cordova ionic-framework

我们正在开发具有Firebase的Ionic应用程序。 这是一个与Ionic v1一起运行的旧项目。 我们正在构建phonegap:

PhoneGap (iOS / Android / Windows)
cli-7.1.0 (4.5.4 / 6.3.0 / 5.0.0)

一切正常,并发布我们想要确保访问Firebase的应用程序。

为了保护对Firebase的访问,我们限制了Google开发者控制台对GoogleAPI密钥的访问,如下所述:

我们在使用iOS版本时遇到了麻烦(适用于android)

我们做了什么:

  1. 在firebase项目中创建iOS应用
  2. 导出GoogleService-Info.plist并将其包含在config.xml中:

<platform name="ios">    
   <resource-file src="GoogleService-Info.plist" />
</platform>
  1. 在Google Developer Console中限制访问我们的捆绑软件ID

现在我们遇到此错误:

Error : {"error":{"code":403,"message":"Requests from this ios client application <empty> are blocked.","errors":[{"message":"Requests from this ios client application <empty> are blocked.","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED"}}

我已经找了两天,但我不明白:

  • iOS应用似乎初始化方式不同,我无法正确传递捆绑软件ID
  • GoogleService-Info似乎在正确的位置,但好像没有使用
  • 在网络上找不到任何有相同问题的人,所以一定是菜鸟的错误...

先谢谢您

大卫

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,并且检查了GoogleService-Info.plist。数据库URL与我的项目不同。因此,请确保所有组件都与您的项目匹配。

这解决了我的问题!

答案 1 :(得分:0)

我遇到了同样的问题。
就我而言,首先实施 Firebase,然后实施 GoogleLogn。
由于没有任何更改,可能会更改应用程序的 Bundle Id。
所以我检查了 Firebase 包 ID,然后在 Xcode 包 ID 变得不同
我在 Xcord 项目中放置了 Firebase 捆绑包 ID。
然后解决这个问题。

enter image description here