marlove / react-native-geocoding

MIT License
208 stars 54 forks source link

Google API key restriction #40

Open kimsean opened 3 years ago

kimsean commented 3 years ago

Hello. How do you handle Google API Key restrictions ? I already added package name and SHA-1 and it seems that its not working. I still don't have access

BaderSerhan commented 3 years ago

I don't think there's a way to do it using this library or any react-native library as a matter of fact.

Check this issue.

Also, check the compatibility section from react-native-google-places-autocomplete library's README file:

Compatibility

This library does not use the iOS, Android or JS SDKs from Google. This comes with some Pros and Cons.

Pros:

  • smaller app size
  • better privacy for your users (although Google still tracks server calls)
  • no need to keep up with sdk updates

Cons:

  • the library is not compatible with a Application key restrictions
  • doesn't work directly on the web without a proxy server
  • any Google API change can be a breaking change for the library.

I think that this library is using the APIs the same way, so I guess you cannot restrict the API keys.

shyammanek commented 2 years ago

Can u please share this Solution

shyammanek commented 2 years ago

I find a solution, https://github.com/devfd/react-native-geocoder if we use Geocoding then we face this restrictions Problem then we use react-native-geocoder this is provide same features and only required Places API service from the Google cloud Console side