ionic-team / ionic-team/capacitor-google-maps

@capacitor/google-maps support for using Places SDK Autocomplete natively on Android | How to restrict the API_KEY

Open
#111 3 comments 1 reaction 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
32
Forks
47
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

### Plugin
- @capacitor/google-maps

### Description
The @capacitor/google-maps native plugin should have support for using the Places SDK for Android natively on Android. The plugin currently works very well with maps. But if you want to add address autocomplete functionality and then center that address on the map it gets complicated. There is no plugin for it.

Places Autocomplete can be implemented with JavaScript from the browser but when trying to restrict the API KEY I have no options to prevent my API KEY from being copied and a surprise cost can be generated.

![image](https://user-images.githubusercontent.com/55035334/173900069-fd01e6bb-77a3-456c-9839-dbf2a5999e05.png)

### Platform(s)
- Android

### Preferred Solution

Native support for Place Autocomplete with [Places SDK](https://developers.google.com/maps/documentation/places/android-sdk/autocomplete) to get suggested addresses and be able to restrict the API key

### Additional Context
- https://stackoverflow.com/questions/62417501/how-to-restrict-api-key-google-maps-for-ios-in-an-ionic-app
- https://forum.ionicframework.com/t/security-concern-cant-restrict-api-access-while-using-googlemaps-browser-api-in-ionic-apps/129577/11

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.