I'm trying to utilize Google Places API in Android app. I'm using React Native and the following package: https://github.com/FaridSafi/react-native-google-places-autocomplete
A) When Android app restriction is set (point 2). I'm getting error:
"google places autocomplete: This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx.xxx.xxx.xxx, with referrer: undefined"
B) When Android app restriction removed (restriction set to None) everything works fine.
Any ideas?
The Google Places API is designed to be used in server-side applications. There are two other Places SDK for Android / IOS, which is designed to be used with mobile applications. The API restrictions are designed to support only these usage. So using Places API in React native, you are kind of left in a field naked. A proper way to do is to develop a wrapper module to use proper SDK in your react native project. You may want to check https://github.com/tolu360/react-native-google-places.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With