Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have a single Google Maps API key for all my apps without registering their package names?

Tags:

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.

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.

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.

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

like image 588
eeVoskos Avatar asked Apr 26 '13 09:04

eeVoskos


People also ask

Can I get Google Maps API key without billing?

It is still possible to enable Maps API without billing, but it has to be done through the Cloud SDK console.

Can Google Maps API key be used in multiple domains?

When you create a Google Maps API key, it can be locked to only be used on specific domains that you authorize. These domain names are called "referrers", and your API key won't work on other domains. If you add or change one of your domains, you may need to update your referrer list for that API key.

Can I use Google Maps API without API key?

API keys are required for apps and projects that use the Google Maps Platform APIs and SDKs.

Is Google Maps API free for mobile apps?

You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).


2 Answers

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

  • Click create new Android key button
  • Don't enter anything into the package names list
  • Click create

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.

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.

like image 134
starkej2 Avatar answered Dec 10 '22 00:12

starkej2


It can answer for 2 ways

Can I have a single Google Maps API key for all my apps?

Yes, you can by register API Key with multiple lines by using enter, like this: enter image description here

but for this question Can I have a single Google Maps API key for all my apps without registering their package names?

No, you can't

*edit image for easier to read

like image 39
Sruit A.Suk Avatar answered Dec 10 '22 00:12

Sruit A.Suk