Raz Buchnik
Raz Buchnik

Reputation: 8411

How to restrict google maps key to cordova android

I have created an API key and restricted it to JS Maps and Android on the google cloud platform. There I added the SHA1 fingertip (which I have from the debug app signing). But what to do from here?

Upvotes: 0

Views: 206

Answers (1)

Eric
Eric

Reputation: 10658

You can't restrict to Cordova Android because there is no domain in this environment. You will have to have a link to the Google Maps api with your key in the index.

But one thing that you can do to protect your key is to not have the link with they key in your html file. You should retrieve the key from your server then append the script tag to you index file. This way, if your app is decompiled, there is no key, as the link is created at runtime.

Upvotes: 1

Related Questions