Flutter Google Direction API "This IP, site or mobile application is not authorized to use this API key."
246
Ok, to be an acceptable answer in here for the next visitors, the application restrictions field does not work as expected. Changing it from Android Apps
to None
fixed the issue.
Author by
SatelBill
Updated on December 26, 2022Comments
-
SatelBill over 1 year
I am testing the Google Directions API on the Flutter Android app. I have created a Google Maps API key as follows:
And I have called BASE_URL https://maps.googleapis.com/maps/api/directions/json?origin=35.098480364448235,-109.62431179538783&destination=35.21340949112603,-113.15068285745188&key=Google_api_key
How to solve this issue?
-
Akif over 3 yearsYou can try to change application restrictions from Android Apps to none. I know, it is nonsense but I fixed the same issue this way.
-
SatelBill over 3 yearsThank you for your answer. But why it is not working when I select Android app? Will it work on both android and iOS?
-
Akif over 3 yearsIt will work on both Android and iOS. But you can define another key for iOS, and use it on iOS too.
-
SatelBill over 3 yearsThank you very much.
-