Automatically change map key based on debug or release version

元气小坏坏 提交于 2019-12-12 01:23:13

问题


Sometimes I forget to change over from my debug Google map key when I compile my app. Is there a way to have it change automatically so that I don't have to manually change it in the manifest everytime and possibly forget to change it for the release build again?


回答1:


The best thing you can do it not to have to change it at all.

First of all, you can check in the API_KEY into your repository even if it is public. Nobody can use the key without having your debug or release keystore (and passwords).

Secondly, you can assign a single API key multiple SHA-1;package pairs in the Google APIs Console.



来源:https://stackoverflow.com/questions/18424539/automatically-change-map-key-based-on-debug-or-release-version

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