3

iOSアプリを開発中です。要件の 1 つは、ユーザーの所在地の国を取得して、アプリで制限を適用することです。私たちが考えている解決策の 1 つは、IP アドレスを収集し、それをジオローカリゼーション サービスで使用して国を取得することです。あるパートナーは、この種のソリューションは Apple のポリシーに違反していると述べています。誰かがこの声明を確認できますか? または、デバイスのユーザーが所在する国だけを収集する別の方法を知っている人はいますか?

4

4 に答える 4

10

Apple が提供する位置情報サービスを使用して、ユーザーの位置を見つけます。IP アドレスからのジオコーディングよりもはるかに正確であり、サード パーティのサービス (ま​​たは独自のサービス) を必要とせず、地図などで使用できる推定緯度と経度をユーザーに提供します。

于 2012-03-08T19:39:52.363 に答える
2

Appleには逆ジオコーダーAPIがあり、CLGeocoderになりました。経度と緯度をユーザーフレンドリーな表現に変換します。この情報を取得するために位置情報サービスとCLGeocoderを使用するので、後で問題が発生することはなく、サードパーティのAPIも必要ありません。

https://developer.apple.com/library/ios/#DOCUMENTATION/CoreLocation/Reference/CLGeocoder_class/Reference/Reference.html#//apple_ref/occ/cl/CLGeocoder

于 2012-03-08T20:12:18.647 に答える
2

Using the Apple-provided location services is only part of the solution. Since location services does not return a country you will need to use a service that takes the latitude and longitude to determine countries nearby. I have used this before for other purposes, but querying something like this web service with the latitude and longitude should return you a country nearby.

http://ws.geonames.org/findNearby?lat=47.3&lng=9

于 2012-03-08T19:45:34.750 に答える
0

Google逆ジオコーディングAPIを使用して、ユーザーの位置座標に基づいて名前が付けられた国を取得できます

于 2012-03-08T19:48:53.233 に答える