我可以仅将Google Direction API限制为iOS应用程序吗? [英] Can I restrict Google Direction API to iOS apps only?

查看:61
本文介绍了我可以仅将Google Direction API限制为iOS应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为我的iOS应用程序使用Google Directions API,但现在我想限制该API密钥只能由我的iOS应用程序使用(由其捆绑包ID指定).

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

推荐答案

Directions API是一种Web服务.与Web服务的API密钥一起使用的限制是IP限制.

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

假定Web服务请求在您的后端服务器上执行.如果需要限制API密钥,解决方法是创建一个中间服务器.您的iOS应用程序应将请求发送到中间服务器,中间服务器应将请求发送到Google并将响应传递回您的应用程序.在这种情况下,您可以通过中间服务器的IP地址来限制API密钥.

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.

这篇关于我可以仅将Google Direction API限制为iOS应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆