Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object { "code": 0, "message": "Geocoder isn't initialized. Call Geocoder.init function (only once), passing it your app's api key as parameter.", #2

Open
khupi opened this issue Feb 19, 2020 · 4 comments

Comments

@khupi
Copy link

khupi commented Feb 19, 2020

  1. When I initialize my google api key hard code into the geocoder it works fine.

const GOOGLE_API_KEY = Config.GOOGLE_API_KEY;

Geocoder.init("my google api key"); it works fine

  1. it fails when referenced from the config env settings in the from the origin code:

const GOOGLE_API_KEY = Config.GOOGLE_API_KEY;

Geocoder.init(GOOGLE_API_KEY);

@ramkarri7
Copy link

Did you ever figure this out??

@khupi
Copy link
Author

khupi commented Aug 18, 2020

Nope, I moved on

@ramkarri7
Copy link

Hey, I just stored the key before I entered that screen when the app renders using context and as I result did not have to deal with that.

@waleed2812
Copy link

That is because return type of Geocoder.init funtion is void. It does not return anything after running. You just need to run it once and use the same Geocoder object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants