简体   繁体   English

发布Google地图的API密钥

[英]Relase api key for google maps

I am about to launch my app which contains google maps. 我即将启动包含Google地图的应用程序。 Earlier I get SHA1 from Windows>Preferance>Android>Build>SHA1 fingerprint . 早些时候,我从Windows>偏好设置> Android> Build> SHA1指纹获取SHA1。 Then I went to google developer console and made api key by SHA1; 然后我去了谷歌开发者控制台,并用SHA1做api密钥; package name. 包裹名字。 I have been doing this for testing. 我一直在做这个测试。

Now I need to release my app to play store. 现在,我需要发布我的应用程序才能玩商店。 I have made a new keystore and there by at the end apk is formed. 我做了一个新的密钥库,到最后形成了apk。

Now some articles are saying I need a diffrent sha1 for releasing google map. 现在,有些文章说我需要不同的sha1才能发布Google地图。 I read a tutorial which made sha 1 from keystore in command prompt and we get another SHA1 finger print. 我读了一个教程,该教程在命令提示符下从密钥库中创建了sha 1,并且获得了另一个SHA1指纹。 So now I am trying to make api key with this sha1 and putting in manifest. 所以现在我试图用此sha1制作api密钥并放入清单。 Am I missing something? 我想念什么吗? Am I on right track? 我在正确的轨道上吗?

You are on right track, but as you said you are a newbie let me help you with details: 您步入正轨,但正如您所说的,您是新手,请允许我提供详细信息:

  • You already had an API key for Google Maps which was made using the debug SHA1 key. 您已经具有使用调试SHA1密钥制作的Google Maps API密钥。

  • Once you have a keystore the you gonna use to sign your release APKs (for app's lifetime), extract the SHA1 from this keystore using the same command prompt method. 拥有keystore ,您将使用它来签署release APK(用于应用程序的生命周期),然后使用相同的命令提示符方法从此keystore提取SHA1。

  • SHA1 is dependent on the "keystore" files, so it will also remain same for app's lifetime. SHA1依赖于“密钥库”文件,因此在应用程序的生命周期中也将保持不变。

  • Now, you just need to update the old SHA1 for your API key to this one. 现在,您只需要将API密钥的旧SHA1更新为该密钥即可。 API key will remain same and you can directly use it. API密钥将保持不变,您可以直接使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM