Hello Ionicers!
I’ve been running an implementation of Google Maps Address autocomplete. it has been working just swimmingly, until the new Android API 28/29. When I run the @ionic/angular app on an Android Pie device I get the “ReferenceError: google is not defined” error.
When I run the same app on an Android 8 device it runs perfectly fine.
What do I need to do differently??
declare var google: any;
updateSearch() {
console.log('updateSearch - ', this.autocomplete.query);
if (this.autocomplete.query == '') {
this.autocompleteItems = [];
return;
}
let me = this;
this.service.getPlacePredictions({
input: this.autocomplete.query,
componentRestrictions: {
country: 'uk'
}
}, (predictions, status) => {
me.autocompleteItems = [];
me.zone.run(() => {
if (predictions != null) {
predictions.forEach((prediction) => {
me.autocompleteItems.push(prediction.description);
});
}
});
});
}