【问题标题】:When Restricted Google Places API Key with iOS bundle identifier, nearby search doesn't work当带有 iOS 捆绑标识符的受限制的 Google Places API 密钥时,附近的搜索不起作用
【发布时间】:2019-10-03 13:16:13
【问题描述】:

我已在我的应用程序中集成了 Google 地图,我想在我的应用程序中显示附近的餐馆。因此,我为此使用了 Google 地点附近的搜索 API。控制台中有此 API 的密钥。当我仅使用其捆绑标识符限制 iOS 应用程序的该密钥时,附近的搜索 API 不起作用。当我删除限制时,它工作正常。我错过了什么? API调用过程中是否需要传递参数?

【问题讨论】:

  • 你得到的是 403 吗?
  • 如果我的回答对你不起作用,请告诉我,否则请接受它作为答案

标签: ios swift google-cloud-platform api-key google-nearby


【解决方案1】:

您需要在请求标头中传递您的 bundle-id:

"X-Ios-Bundle-Identifier":"Your bundle id"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-18
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多