web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Fake Gps

(0) ShareShare
ReportReport
Posted on by 248

Hello,

 

i am currently developing an app to detect current location, actually if i click a button a label will show my current location name and then there is a button will not visible if the location is not in my location. However, it can be tricked by using fake gps, my question is, how to detect if user using fake gps or how to overcome this issue

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @AdhamFH :

    Are your users using this app on mobile devices?

    This is probably an almost unsolvable problem. Especially if the user has obtained root access to the mobile device, then he can cheat almost as much as he wants.

    My idea is that if the user's GPS positioning is real, then it must be able to change multiple times in a short period of time (I tested that only a small range of movement is required, and the positioning value will change). If the GPS positioning is a fake value, it is difficult for the user to adjust the GPS position multiple times in a short period of time (for example, change twice within 10s)

    So my method is to verify the GPS position 3 times in 9s, If the 3 times of latitude and longitude recorded by the app in 9 seconds are the same, then the button is not displayed.

    1\Add a timer control

    AutoStart

     

    true

     

    Duration

     

    3000 /*loop in 3S*/

     

    OnTimerEnd

     

    Collect(
     thecollection,
     {Value: Location.Latitude & Location.Longitude}
    ); /*thecollection is my custom collection*/
    If(
     CountRows(thecollection) = 3 && !(Last(
     FirstN(
     thecollection,
     1
     )
     ).Value = Last(
     FirstN(
     thecollection,
     2
     )
     ).Value && Last(
     FirstN(
     thecollection,
     2
     )
     ).Value = Last(
     FirstN(
     thecollection,
     3
     )
     ).Value && Last(
     FirstN(
     thecollection,
     1
     )
     ).Value = Last(
     FirstN(
     thecollection,
     3
     )
     ).Value),
     Set(
     Visible,
     true
     ) /*Visible is my custom variable*/
    );
    If(
     CountRows(thecollection) = 3,
     Clear(thecollection)
    )

     

    Repeat

     

    If(Visible,false,true)

     

    Visible

     

    false /*make it unvisible*/

     

    2/set the button's Visible property to:

     

    Visible

     

    If the app records the same latitude and longitude 3 times in 9 seconds, the button will not displayed.

    The most important thing is that you can’t tell the user the logic of your backend, otherwise smart users may still find ways to cheat.

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard