Can I restrict Google Direction API to iOS apps only?

懵懂的女人 提交于 2019-12-20 00:49:43

问题


I've been using Google Directions API for my iOS app, but now I want to restrict the API key to be used by my iOS apps (specified by their bundle IDs) only.

Is there any solution for this? Thanks


回答1:


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 iOS 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.



来源:https://stackoverflow.com/questions/40736854/can-i-restrict-google-direction-api-to-ios-apps-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!