I am trying to add an image of a map using the Google Maps Static API in React Native.
I am using the directions api to obtain the overview_polyline data and incorporating that into a url that is then signed using the google cloud digital signature before being passed in to the source prop ({ uri: (my url)}) of Image.
The image is not rendered on screen with no error messages.
I have tried using fetch() in a trycatch statement and the response I get is:
The Google Maps Platform server rejected your request. Unable to authenticate the request. Provided 'signature' is not valid for the provided API key, or the provided 'key' is not valid. The signature was checked against the URL: /maps/api/staticmap?&size=400x400&path=weight:3%257Ccolor:0x0352A0CC%257Cenc:(polyline)&key&mapID&signature.
However, when I use the exact same url in safari and chrome (with the same API key and signature) it renders the image.
I have tried:
both altered the url so it no longer worked in the browser.