Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Error - Requests from this ios application <empty> are blocked

We are developing an Ionic App, with firebase. This is an old project, running with Ionic v1. We are building on phonegap :

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

Everything was working fine and to release the app we want to secure access to firebase.

To secure access to firebase, we restricted access to GoogleAPI key from Google developer Console as explained here :

  • https://firebase.google.com/support/guides/launch-checklist

  • https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions

And we are having trouble with the iOS version (works fine for android).

What we did :

  1. Create an iOS app in firebase project
  2. Export GoogleService-Info.plist and include it in config.xml :

:

<platform name="ios">    
   <resource-file src="GoogleService-Info.plist" />
</platform>
  1. Restrict access to our bundle id in google developer console

Now we have this error :

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"}}

I have been looking for two days, but I do not understand :

  • It seems that iOS apps are initialized differently and I cannot pass the bundle id properly
  • GoogleService-Info seems to be in the right place but, it is as if it was not used
  • Cannot find anyone with same problem on the web so it must be a rookie mistake ...

Thank you in advance,

David

like image 678
David Avatar asked Feb 16 '19 06:02

David


1 Answers

I had the same issue and I checked GoogleService-Info.plist. Database url was different with my project. So, be sure that all components match with your project.

This solved my issue!

like image 152
zeynep tokcan Avatar answered Nov 09 '22 08:11

zeynep tokcan