Android Google Maps Direction Api - Api key restriction not working

前端 未结 3 1332
旧巷少年郎
旧巷少年郎 2020-12-03 22:09

When we are setting a Key restriction to NONE for Google Maps Direction Api, It works fine.

But When we set

3条回答
  •  庸人自扰
    2020-12-03 22:20

    Directions API is a web service. The restrictions that will work with an API keys for web services are IP restrictions.

    It is supposed that web services requests are executed on your backend servers. If you need to restrict an API key, the workaround is to create an intermediate server. Your Android application should send requests to the intermediate server, intermediate server should send requests to Google and pass responses back to your app. In this case you can restrict an API key by IP address of your intermediate server.

    Have a look at this document:

    https://developers.google.com/maps/faq#using-google-maps-apis

    Hope this clarifies your doubt.

提交回复
热议问题