Search code examples
iosiphonegeolocationlocationcore-location

Detect/Stop Spoofing of Location possible in iOS sdk?


I am having an application in which users need to visit particular locations. When users are nearby to this location a form is being open to fill. I have doubt that some users are spoofing their current locations(using any other application) and filling form at their home. Means fooling to my application.

I searched on Apple store and there is no application available for GPS spoofing or the application which can spoof location coordinates for other application in the iOS device.

I googled it and found that spoofing is possible on Jailbroken devices and some applications are available on Cydia store like "akLocationX", "Fake Location" etc. Below is the article on the same.

http://www.addictivetips.com/ios/easily-fake-iphone-current-location-aklocationx/

Could anyone help me, how can I stop this location spoofing on Jailbroken devices?


Solution

  • The other posters are correct, one great way to check is to verify if the device is jailbroken.

    But, even if the device isn't jailbroken, it is still possible to fake the GPS location with a nearby GPS transmitter. So let's assume (although it is highly unlikely), that your user has this.

    Technically, it is possible to detect if the GPS location is fake or not. However, your ability to do so is dependent on if the person faked other information as well such as nearby Wifi networks, or their external IP (such as using a VPN).

    Reference: GPS Jamming Devices

    Method A - Wifi

    You can detect the wireless networks nearby and then lookup their locations and compare that to the one reported by your GPS. There are a couple of issues however.

    Keep In Mind

    • You must maintain network access to the internet.
    • You must use private APIs to do this which are not approved for usage by apps within the AppStore so you would never be able to publish it there.
    • Wifi must be enabled on the device and your app doesn't have any control to enable or disable it.
    • The GPS location of the Wifi hotspot may not be accurate, but is often more accurate than that obtained from a device's internet IP such as in method B.

    References:

    Method B - Your device IP

    You can connect to an online service which returns your location information based on your IP. You can then compare this to the GPS location which you were provided.

    This will get through the app store review process, however...

    Keep In Mind

    • You must maintain network access to the internet.
    • Your device IP maybe through a VPN which may report a location other than that which the device actually exist in.
    • The GPS location information for the device's internet IP may not be accurate.
    • You can't rely on your device's current network IP, you must query it from an internet source. This is because your device may exist behind a firewall, gateway, or other network barrier.
    • Your device IP location will NOT be very accurate, you could confirm a city/state in most cases, but any finer detail isn't likely to be accurate.

    References: