I'm working on an app with multiple Google APIs. The app has a Marker which can be moved with drag&drop or click on map. I have a listener that takes the new LatLng and makes a call to this endpoint - https://maps.googleapis.com/maps/api/geocode/json?latlng=LAT_LNG&key=API_KEY
The Retrofit method looks like this, the base URL is already added in the Retrofit.Builder() and here I add the geocode/json part
@GET(ApiRoute.GEOCODE)
suspend fun getAddress(
@Path("latlng") latLng: String?,
@Path("key") apiKey: String,
): Response<ReverseGeocodeEntity>
Environment:
- I have the INTERNET permission
- I have an API key (which I use above for the "key") defined in Google Play Console which is restricted on Android apps where I have 5 SHA1 keys added (2 local debug for developers, 1 Firebase, 1 Google Play Store for production and 1 Keystore certificate)
- 7 APIs in the above API key where the Maps SDK for Android and Geocoding API are present.
My call fails with status: REQUEST_DENIED and error_message: This IP, site or mobile application is not authorized to use this API key. Request received from IP address IP_ADDRESS, with empty referer. Weirdly, it works if I take out the Android apps restriction..
Everything I looked up is either old or not relevant.. and the setup looks good from my point of view, I don't think I've missed anything.. did someone encounter this issue?