我可以有一个谷歌地图API密钥为我所有的应用程序没有注册自己的包名? [英] Can I have a single Google Maps API key for all my apps without registering their package names?

查看:271
本文介绍了我可以有一个谷歌地图API密钥为我所有的应用程序没有注册自己的包名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了一个Android库项目,包括自定义MapFragments,基于谷歌地图Android版V2 API。在谷歌API的控制台,我已经注册库的包名称与我的调试/签名的证书。

I have written an android library project that includes custom MapFragments, based on Google Maps for Android v2 API. In the Google APIs console, I have registered the library's package name with my debug/signed certificates.

我需要创建一个使用这个库共同code碱基不同的应用程序,我想知道是否有一种方法可以仍然使用图书馆的MapFragments,,而无需添加每个应用程序的包名在谷歌API的控制台。我需要这个,因为我要自动化应用程序的创建(与詹金斯),我不希望任何手动步骤,如登录到API控制台和注册程序包的名称。

I need to create various apps that use this library as common code base and I was wondering if there is a way to still use the MapFragments of the library, without having to add each app's package name in the Google APIs console. I need this because I want to automate app creation (with Jenkins) and I don't want any manual steps, like logging in to the APIs console and registering the package name.

到目前为止,我还没有设法找到一个方法来做到这一点。通配符不工作(如具有的 com.mycompany。的*为控制台包名),如果我没有明确地注册的每个应用程序的包名,地图不加载。

So far, I haven't managed to find a way to do this. Wildcards don't work (e.g. having com.mycompany.* as package name in the console), and if I don't explicitly register each app's package name, the map doesn't load.

是否有可能以某种方式使MapFragments查找的的的,而不是单一的API密钥/包,应用程序的?

Is it possible to somehow make the MapFragments look up the library's single api key/package, instead of the app's?

推荐答案

下面是如何完成你想创建一个新的API密钥时做的事:

Here's how to accomplish what you're trying to do when creating a new API key:

  • 单击创建新的Andr​​oid按键
  • 请不要输入任何内容到包名称的列表
  • 点击创建

这时你应该会看到AndroidApps:任何应用程序允许的,并且可以使用在所有的应用程序中的地图API密钥而不API控制台上的任何配置

Then you should see AndroidApps: Any app allowed, and be able to use that maps API key in all of your apps without any configuration on the APIs console.

既然你可能已经进入了证书指纹为每个应用程序,只需点击编辑允许Android应用程序,从列表中删除它们,单击更新,应该说任何应用程序被允许使用该API密钥。

Since you have probably already have entered the certificate fingerprints for each of your applications, just click Edit allowed Android apps, delete them all from the list, click update, and it should say any app is allowed to use that API key.

这篇关于我可以有一个谷歌地图API密钥为我所有的应用程序没有注册自己的包名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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