# Google javascript API restrictions for android?

**URL:** <https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919>\
**Category:** Capacitor\
**Created:** [August 11, 2022, 3:37pm UTC](https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919 "2022-08-11T15:37:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottieslg](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/scottieslg/32/116764_2.png) [@scottieslg](https://forum.ionicframework.com/u/scottieslg)\
**Post date:** [August 11, 2022, 3:37pm UTC](https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919/1 "2022-08-11T15:37:29Z")

</div>

I am using the google api javascript plugin.

On the google api credentials page, it allows you to restrict to only apps that meet the criteria for my app so that nobody else can steal my key and rack up thousands of dollars of map fees.

I currently have capacitor://myApp as the allowed domain, and this seems to work fine on iOS, but not Android. If I remove all the restrictions, it works fine on Android and iOS, so it appears to be a problem with the url not matching.

What url is android using?

---

<div class="post-metadata">

**Author:** ![Hills90210](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Hills90210](https://forum.ionicframework.com/u/Hills90210)\
**Post date:** [August 11, 2022, 4:05pm UTC](https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919/2 "2022-08-11T16:05:15Z")

</div>

Android uses: [http://myApp](http://myApp)

---

<div class="post-metadata">

**Author:** ![dallas](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dallas/32/141875_2.png) [@dallas](https://forum.ionicframework.com/u/dallas)\
**Post date:** [August 15, 2022, 6:10pm UTC](https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919/3 "2022-08-15T18:10:41Z")

</div>

You can set this in the Capacitor config file what scheme and host name you want your app to use, but also, anyone can do the same, so it’s not really a great way to secure your Google keys. Specifically for this case, this is a big reason you would want to use a native library where possible.

We do have the Google Map plugin that would handle this for you, though I’m also aware that it doesn’t cover the fully maps API at this time, which may make it not quite what you need (though if this is the case, we’d love feedback and feature requests!)

---

<div class="post-metadata">

**Author:** ![scottieslg](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/scottieslg/32/116764_2.png) [@scottieslg](https://forum.ionicframework.com/u/scottieslg)\
**Post date:** [August 28, 2022, 4:45pm UTC](https://forum.ionicframework.com/t/google-javascript-api-restrictions-for-android/225919/4 "2022-08-28T16:45:18Z")

</div>

I use predictive address search and route optimization for my maps. Does the capacitor plugin have those?

Also, what setting do I change in the config file for the host name?
