iOS的Places API未启用错误 [英] The Places API for iOS is not enabled error

查看:85
本文介绍了iOS的Places API未启用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法调用places API

错误:操作无法完成. iOS的Places API是 未启用.请参阅开发人员指南 ( https://developers.google.com/places/ios-api/start)有关如何启用 适用于iOS的Google Places API.

我已按照本指南 Places API入门:

1)安装API(Pod文件和Pod安装)

2)设置API密钥并将其限制为iOS

3)在AppDelegate中添加密钥(GMSPlacesClient.provideAPIKey("YOUR_API_KEY"))

但是,我仍然遇到上述错误.

这是要启用的正确API吗?

我已经等待了30分钟以上(现在已经超过17个小时),以使API密钥设置生效,但错误仍然存​​在.我可以使用相同的键来使Maps API正常工作.

版本:"GooglePlaces(2.7.0)" + iOS12.0

解决方案

将Podfile中的版本从2.7.0更新到3.0.3后工作

  pod 'GooglePlaces', '= 3.0.3'
  pod 'GooglePlacePicker', '= 3.0.3'
  pod 'GoogleMaps', '= 3.0.3'

安装GoogleMaps 3.0.3(原为2.7.0)

安装GooglePlaces 3.0.3(原为2.7.0)

仅注意到文档中有一条注释指出:

重要提示:从2019年1月29日起,不推荐使用Place Picker. 该功能将于2019年7月29日关闭,并且不再 在该日期之后可用. 继续使用位置选择器 在整个弃用期内,请不要迁移到新的SDK, 且请勿在您的Google Cloud中禁用iOS的Places SDK for iOS服务 这样,平台项目也会禁用位置选择器".

虽然它提到它将在2019年7月29日关闭,但显然现在不起作用.也许我需要还原代码以使用以前的版本.

I'm not able to call the places API

Error: The operation couldn’t be completed. The Places API for iOS is not enabled. See the developer's guide (https://developers.google.com/places/ios-api/start) for how to enable the Google Places API for iOS.

I've followed this guide Places API getting started:

1) Install the API (Pod file and pod install)

2) Setup the API Key and restrict it to iOS

3) Add the key in AppDelegate (GMSPlacesClient.provideAPIKey("YOUR_API_KEY"))

However, I'm still hitting the above-mentioned error.

Is this the correct API to enable?

I've waited for more than 30 mins (more than 17 hours now)for the API key settings to take effect but the error still persist. I'm able to use the same key to get Maps API to work though.

Version: "GooglePlaces (2.7.0)" + iOS12.0

解决方案

Works after updating the version in Podfile from 2.7.0 to 3.0.3

  pod 'GooglePlaces', '= 3.0.3'
  pod 'GooglePlacePicker', '= 3.0.3'
  pod 'GoogleMaps', '= 3.0.3'

Installing GoogleMaps 3.0.3 (was 2.7.0)

Installing GooglePlaces 3.0.3 (was 2.7.0)

Just noticed there's a note in the documentation which states:

IMPORTANT: The Place Picker is deprecated as of January 29, 2019. This feature will be turned off on July 29, 2019, and will no longer be available after that date. To continue using the Place Picker through the deprecation period, do NOT migrate to the new SDK yet, and do NOT disable the Places SDK for iOS service in your Google Cloud Platform project, as doing so will also disable the Place Picker.

Apparently it's not working now although it mentioned that it will be turned off on July 29, 2019. Perhaps I need to revert the code to use the prior version.

这篇关于iOS的Places API未启用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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