cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Location check

I have a screen that uses Location, but when testing to see if the GPS is on, I've come across issues;

 

Firstly, please check my logic on the testing portion;

  • Location is never Empty - it always contains .Latitude and .Longitude even when they're blank.  
  • Thus, the check to see if GPS is on or off seems to be IsBlank(Location.Latitude)  [please correct me if I'm wrong!]

 

 

Here's the scenario:

User starts the App with GPS off.

When it comes to the screen that uses GPS, it detects that it's off and prompts the user to switch it on.

 

Here's the problem: 

When the user enables GPS, (after starting the app) the app doesn't RE-check Location.  It remains blank.

It doesn't update dynamically.

It doesn't update when I apply a Location.Latitude check on a button action.

It doesn't update when I navigate away from the screen and back again.  

 

It only re-checks and successfully updates when I navigate away from the APP entirely (i.e. launch a different app window like a browser) - as soon as I come back the Location has been updated.

 

Once the Location has been updated, if I turn GPS OFF, it doesn't clear the Location.  It retains the last entry no matter what I do.

 

This creates some sticky issues!

Can someone advise if this is in fact expected behaviour and/or perhaps some workarounds?  Is there a way to force a location recheck, similar to what happens when the app goes into background/foreground state?

5 REPLIES 5
Community Support Team
Community Support Team

Re: Location check

Hi Russel_Thomas,

 

I test this issue on my side. With the GPS is OFF on my device, I open the app and the screen is just blank. Then I try to turn on the GPS, back to the app, the screen is still blank. I found that only when I re-open the app the location will be updated.


And also if I turn off the GPS, it doesn’t clear the location. Only when I re-open the app, it turns to be blank.


Thanks for reporting. I am confirming with this issue from my side, and I will back to you once I got any updates.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Location check

Hi Russel_Thomas,

 

PGs are working on this issue. I guess that it would be fixed soon, but I don’t have a timeline.
I will back once I got any updates.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Location check

Thanks a mil - based on the behaviour I'm guessing Location is just a container that gets updated from an underlying call to location services (let's call it GPS to avoid confusion with the Location function in PowerApps)  - so when you turn the underlying GPS service off, if the Location container had Latitude and Longitude values from a previously successful check, it wouldn't be overwritten with a blank value.  Thus subsequent checks even after GPS is off yield the last saved value.

 

Probably not a bad thing for retaining 'last successful read', but there's got to be a better way of determining if GPS is on or off than just trying to pull a location out of it... Smiley Happy

 

It looks like the initial check for GPS/Location Services is at the start of permission prompt for using Location, or the OnCreate and possibly also on the OnResume state of the PowerApps Android App?

 

For me, it updates when I cycle the app through a state change (Android OnResume state looks like the likely suspect).

I can do this by launching a browser window from the app and forcing the user to then switch back to the app.  Not ideal, but fine for now I guess.

 

Will wait to see further updates - thanks Smiley Happy

 

joao_pires
Level: Powered On

Re: Location check

Hi,

I have the same problem. Can you tell me if there is any solution or alternative to this issue?

 

Thanks

 

João Pires

Anonymous
Not applicable

Re: Location check

@joao_pires The only workaround I've found so far is to tell the user to put it on, then when they click a button to say they've put it on,

Launch("http://someurl"); Navigate("previous_screen", Transition.none)

 

This will put PowerApps in the background and launch the phone browser - The website can be some message with HTML5 that confirms their GPS is on, or I just use google maps - then when they return to powerapps and they navigate back to the screen using the GPS, PowerApps now reads it.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 364 members 4,575 guests
Please welcome our newest community members: