React Native - «Ошибка сервера при геокодировании ...» - PullRequest
0 голосов
/ 23 марта 2020

Я пытаюсь получить координаты заданного адреса в React Native. Я пробовал следующее:

import Geocoder from 'react-native-geocoding';
    Geocoder.init("AIz...ZI");
    Geocoder.from("London Eye")
        .then(json => {
            var location = json.results[0].geometry.location;
            console.log(location);
        })
        .catch(error => console.warn(error));

Я вставил «...» в API, чтобы скрыть весь ключ.

Когда я вызываю метод, в котором этот код в, я получаю ошибку:

{"code": 4, "message": "Error from the server while
geocoding. The received datas are in the error's 'origin'
field. Check it for more informations.", "origin":
{"error_message": "The provided API key is invalid.", "results":
[], "status": "REQUEST_DENIED"}}
...