How can I check / trust the location of an iOS or Android device from the server?

I am writing a server to support a local application for iOS and Android. The app requires us to verify the user's identity and location. I know how to do the first, but not the last.

Is it possible to verify that the sender that the client sends to me is actually the best estimate of his current location? I worry that a malicious client spoofs a location and pretends to be a system.

CLARIFICATION: I would like to know how the server can trust through some kind of location verification process that it sent.

I can figure out how to get the user's location from the device. For example, on the Android platform, my application would register to get android.location.Location s, pull out lat / lon and send it to the server.

But how can I convince the server that I didnโ€™t just do it? From the serverโ€™s point of view, why should it assume, when lat / lon is set, that the user is actually there (or next to it for sure)?

Perhaps there is some way to sign the data?

How do servers for apps like foursquare and Facebook verify that the location data they give it is not faked?

+4
source share
3 answers

Write your own Android or iOS client. Since I am working on android, this is very simple code. You need to write one service that runs in a given period of time. This service will retrieve the location. Thus, you will be sure that what you get is only your code. Now the next point is accuracy. You can use the criteria class in android. You can define your own criteria for choosing a location.

+1
source

Record a service on Android and iOS that publish the current lat / long frequency on the server. And also write a code that takes lat / long periodicaly from the server and manipulates it on an Android or IOS card.

Enjoy. :))

0
source

From what I can say, I don't find it possible to detect location spoofing on iOS when this is done using Xcode and GPX files to simulate a location. All applications, even the iOS Map application, will consider your location to be installed in the GPX file used to simulate your location using Xcode.

Additional information about this method: http://www.neglectedpotential.com/2013/04/spoofing-location-services-in-ios/

0
source

Source: https://habr.com/ru/post/1397153/


All Articles