fluttercommunity / flutter_google_places

Google Places - Google places autocomplete widgets for flutter. No wrapper, use https://pub.dev/packages/google_maps_webservice. Maintainer: @juliansteenbakker
https://pub.dev/packages/flutter_google_places
Other
305 stars 422 forks source link

This IP, site or mobile application is not authorized to use this API key. #127

Closed charleshan closed 3 years ago

charleshan commented 4 years ago
This IP, site or mobile application is not authorized to use this API key. Request received from IP address x.x.x.x, with empty referer

It looks like this library doesn't let us use app restricted API keys.

Here is the solution: https://github.com/humazed/google_map_location_picker/issues/31

zeshuaro commented 3 years ago

I've made a PR (https://github.com/lejard-h/google_maps_webservice/pull/88) on google_maps_webservice, which is used by this plugin for making the Google API calls, to support app restricted API keys. Once it's merged and updated, this plugin can also be updated to support app restricted API keys.

Update 1 The PR above is outdated as I've submitted another PR instead (https://github.com/lejard-h/google_maps_webservice/pull/89) to better manage the dependencies of the packages. I've also drafted a PR #136 here which can be merged once the other package has been updated.

Update 2 google_maps_webservice has been updated and I've also updated my PR #136. Once it's merged and updated, this package should work with API keys that are restricted to iOS or Android.

In the mean time, feel free to use my branch which contains all these changes.

dependencies:
  flutter_google_places:
    git:
      url: https://github.com/zeshuaro/flutter_google_places.git
      ref: feature/restricted-api-keys