Using one Google Maps API key for different android applications

让人想犯罪 __ 提交于 2019-12-05 08:15:05

You can use the same keystore and the API key for different applications.

  1. Use the same key to sign your apps.
  2. Add a line for each application in the Console page.

So, something like this:

BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75;com.example.android.mapexample
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75;com.example.android.anotherapp
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75;com.example.temp.lastapp

And now, you can use the same API key with all these apps.

You can use the same SHA-1 print for different pacakages, but you'll have to make different API keys for different apps. And yes, Google will generate a new key everytime you make a request.

Old question, but the accepted answer is against best practice. You can use the same API key, but it is best not to. From the Best Practices Docs:

Use independent API keys for different apps. This limits the scope of each key. If an API key is compromised, you can delete and revoke the impacted key without needing to update your other API keys.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!