ios – Google Gemini API call not sending bundle ID, causing 403 error


[GoogleGenerativeAI] Response payload: {
  "error": {
    "code": 403,
    "message": "Requests from this iOS client application \u003cempty\u003e are blocked.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "API_KEY_IOS_APP_BLOCKED",
        "domain": "googleapis.com",
        "metadata": {
          "consumer": "projects/REMOVED-THE-PROJECT-ID",
          "service": "generativelanguage.googleapis.com"
        }
      }
    ]
  }
}

Here you can see the 403 error with it saying messages from “u003cempty” are blocked. What I get from this is the bundle ID is not being sent with the request. This started happening after I added key restrictions for my API key for my iOS app. Any insights are welcome and if more information is needed please let me know and I will happily provide.

I have tried removing the API restrictions and everything works fine. However, I really want to have them in place for obvious reasons.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img