react-native-google-autocomplete icon indicating copy to clipboard operation
react-native-google-autocomplete copied to clipboard

Empty locationResults

Open chaosLegacy opened this issue 6 years ago • 15 comments

Hi, Great package sir, I'm having an issue for displaying the autocomplete data provided from google API, I've followed all the steps in the readme file, I've created my API key and I've added it to the component. When I start typing the locationResults is always empty, I don't understand is there a way to debug this to see if the problem is related to the API key or some issue in the library itself

<GoogleAutoComplete apiKey={Global.GOOGLE_MAPS_API_KEY} debounce={debounce} minLength={minLength}> {({ inputValue, handleTextChange, locationResults, fetchDetails, isSearching, }) => ( <React.Fragment> <Input value={inputValue} onChangeText={handleTextChange} placeholder={placeholder} style={inputStyle}/> {isSearching && <Spinner size='large'/>} <View style={styles.mainView}> <ScrollView style={styles.scrollViewStyle1} contentContainerStyle={styles.homeView}> <Text>data: {locationResults}</Text> {locationResults.map((el, i) => ( <LocationItem {...el} fetchDetails={fetchDetails} key={String(i)} /> ))} </ScrollView> </View> </React.Fragment> )} </GoogleAutoComplete>

screen shot 2018-09-10 at 2 56 11 am

chaosLegacy avatar Sep 10 '18 02:09 chaosLegacy

I am having the same issue right now, did you figure it out yourself ?

YannickLeRoux avatar Oct 23 '18 03:10 YannickLeRoux

Hi @YannickLeRoux It's actually a problem related to the key API its self I was using, if you can see in the screenshot I shared you can notice that I've got 82 errors related to my API key that wasn't working, so the solution is simply to change your API key. Hope that will work. Let me know so I can close the issue once you've got things working with you.

chaosLegacy avatar Oct 23 '18 08:10 chaosLegacy

I have been trying to use your package and I am getting the same error as chaosLegacy. I am just piling up errors in my calls to google places. Any ideas as to how I can debug this?

rynpowers avatar Nov 11 '18 00:11 rynpowers

Same error here

iamshadmirza avatar Nov 21 '18 04:11 iamshadmirza

I will check this weekend sorry about that.

EQuimper avatar Nov 21 '18 17:11 EQuimper

I am currently having same error... Did someone figure out??

YeonwooSung avatar Feb 21 '19 00:02 YeonwooSung

I think I figured out - This API error happens when you don't set up the payment account for the google api. So, if you use google places api (or google directions api) more than the limit, then the google map api will automatically blocks your request.

YeonwooSung avatar Feb 21 '19 01:02 YeonwooSung

Wow I didn't they block your request, I will try to check if they return another status code, maybe I can make the lib return a boolean when you hit a limit. What you think of this ?

EQuimper avatar Feb 21 '19 14:02 EQuimper

@EQuimper Yeah, that would be great!

YeonwooSung avatar Feb 21 '19 18:02 YeonwooSung

perfect I will do this, I'm open to pr also if you want to make it @YeonwooSung :)

EQuimper avatar Feb 22 '19 00:02 EQuimper

I still have this error. Any solution?

guiguerino avatar Jan 31 '20 16:01 guiguerino

I still have this error as well. Some sort of error to let us know that it's being blocked would be great.

cfchacon10 avatar Feb 26 '20 06:02 cfchacon10

@cfchacon10 do the api key is web ? Someone did use android or ios api key but don't work. Here we use the web api.

EQuimper avatar Feb 26 '20 12:02 EQuimper

They ask for a request web address for change to http web, google service have the option to set none. Im having the same issue

memartello avatar Mar 23 '20 21:03 memartello

@memartello I will make a new video about how to setup this

EQuimper avatar Mar 24 '20 13:03 EQuimper