I implemented Google Places API in my react native project and I'm trying to query places search with the GooglePlacesAutocomplete
but for android it only works while testing with expo and when I build a test apk and install on a real device no result is returned and GooglePlacesAutocomplete does not work. it is difficult for me to trace this error because in development environment everything works perfectly. please I really need help. below is how I query google places
return (
<SafeAreaView style= {{backgroundColor: 'white', height: "100%"}}>
<View >
<Text style ={{ color: 'black',
fontWeight:'bold',
fontSize: 25,
padding: 10}}>Lets Move it!</Text>
<GooglePlacesAutocomplete
placeholder='Move from?'
styles={{
container: {
flex: 0,
},
textInput: {
fontSize: 18,
backgroundColor: 'white',
borderWidth: 1,
padding: 8,
margin: 8,
borderColor: '#a29e9e11'
}
}}
onPress={(data, details = null) => {
dispatch(setOrigin({
location: details.geometry.location,
description: data.description
}))
dispatch(setDestination(null))
}}
fetchDetails ={true}
enablePoweredByContainer={false}
query={{ key: GOOGLE_MAPS_APIKEY, language: 'en'}}
nearbyPlacesAPI='GooglePlacesSearch' debounce={400}
/>
</View>
<View style ={{flex:1}}>
<BottomView />
</View>
</SafeAreaView>
)
}