Search code examples
flutterdartflutter-webmock-location

How to prevent user from using fake gps in Flutter Web (PWA)


I build a Flutter Web project, but I would like to know, is there a package that can handle user to prevent from using fake gps or mock location? for Android and iOS, there is package called trust_fall and trust_location to detect mock location.. how about package for Flutter Web? is there an available package for Flutter Web to detect mock location?


Solution

  • trust_fall depends on detecting jailbroken or SafetyNet failure, which isn't available for a webpage while trust_location credits LocationAssistant for the algorithm it use, which rely on Location.isFromMockProvider() that also unavailable for a webpage. You can use IP geolocation, but that's fraught with false positives from VPN use, and at most only accurate up to a city level.