OGeek|极客世界-中国程序员成长平台

标题: android - 用于测试的 Google Maps API KEY [打印本页]

作者: 菜鸟教程小白    时间: 2022-11-6 16:15
标题: android - 用于测试的 Google Maps API KEY

我想为 GoogleMaps 添加一个 API_KEY 用于测试,并且在我读过的文档中:

Tip: During development and testing, you can register a project for testing purposes in the Google Cloud Platform Console and use a generic, unrestricted API key. When you are ready to move your app into production, register a separate project for production, create an Android-restricted API key, and add the key to your application.

我的问题是,即使是测试 API_KEY,我是否也必须输入信用卡?我不明白让我的 Creadit 卡使用 Google map 的目的,它不是免费的吗?



Best Answer-推荐答案


没有信用卡似乎没有办法免费获得 google maps api key 。要测试谷歌地图的功能,您可以在保留 api 关键字段“EMPTY”的同时使用它。它将显示一条消息“仅用于开发目的”。这样您就可以测试 google map 功能,而无需为 google map api key 输入帐单信息。

<script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap" async defer></script>

关于android - 用于测试的 Google Maps API KEY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52248646/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4