cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlister
Advocate III
Advocate III

Location.Latitude and Location.Longitude iOS - must close and re-open app on 1st attempt

Hello,

I am using iOS 12 with PowerApps release 3.18094.26. I am using the formula Set(CurrentLatitude,Location.Latitude) on the OnSelect action for a button. The variable, CurrentLatitude is set as the text value in a label. The issue I am experiecing is when opening the application on the first attempt, the app is requesting permission to use location services; however, the Location.Latitude remains blank. Only when I close and re-open the app is the CurrentLatitude populated with the Location.Latitude. As a work-a-round, I thought I could just use the Launch formula to re-launch the app. However, Launch doesn't seem to work when launching an app that is already open.

Any suggestions or ideas on how to handle retrieving Location.Latitude & Location.Longitude on the initial launch in iOS? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @jlister,

Just an update - The PowerApps Support Team is investigating this issue, and they are currently releasing a fix with version 3.18101.29 for both Android and iOS which will be live in the stores by this Friday.

 

Best regards,

Kris

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

View solution in original post

13 REPLIES 13
jlister
Advocate III
Advocate III

The issue I am experiencing is not being able to retrieve Location.latitude and Location.longitude when opening an app on the first launch. I am using PowerApps release 3.18094.26 and tested on iOS 11 and iOS12 with multiple devices. On the initial launch, PowerApps does request to use location services, which I did accept and PowerApps is allowed to "Always use" location services on both devices. The longitude and latitude values are outputted to a label and they appear correctly on all subsequent attempts to launch the app, just not on the initial launch. Please help.

I would like to avoid instructing the users from having to relaunch the app just to use the location services. I hope someone can look into this issue and report back.

Thank you,

John

 

v-xida-msft
Community Support
Community Support

Hi @jlister,

Thanks for your feedback, I have made a test, and the issue is confirmed on my side.

I think this issue is related to Location function, I would post this issue to my product team, if the issue is solved, I would reply here.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xida-msft
Community Support
Community Support

Hi @jlister,

Just an update - The PowerApps Support Team is investigating this issue, and they are currently releasing a fix with version 3.18101.29 for both Android and iOS which will be live in the stores by this Friday.

 

Best regards,

Kris

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

Thanks for the quick response.

@v-xida-msft Did this issue got solved? I am still having users having frozen GPS location because of this

Anonymous
Not applicable

@v-xida-msft , @luuminhvuong93 , @jlister 

Hi,

 

with me this works, however the thing is the is replaces the dot with a comma???

 

How can I resolve this?

 

Nick, I need more information to understand what you are requesting. Can you provide the formula that you are using to collect the location?

Anonymous
Not applicable

Hi @jlister 

 

It is an app where the technician clicks on START when he goes to the client, and a STOP button when it is done at the client and goes to the next one.

When clicking on START this is executed:

Patch(..... , { StartLocatie:"https://www.google.com/maps/dir/" & var_currentLat & "," & var_currentLong } )

 

Where var_currentLat is set when the screen is opened and in the OnVisible I put : UpdateContext({var_currentLat: Location.Latitude})
;UpdateContext({var_currentLong: Location.Longitude})

 

Basically the same happen when he clicks on STOP, but then the field StopLocation is altered in the Sharepoint list.

 

 

To be clear, instead of receiving a value of "53.2734" for latitude, you are seeing "53,2734"?

Here is how I would begin to troubleshoot this issue. First, I would temporarily insert two labels and set label1's text property to Location.Lattitude and label2's text property to var_currentLat. If the outputs are as expected, then I would start looking at what is happening to the format in Share Point. What data types are the columns in SharePoint? If it is only the latitude getting converted on the stop position and the stop coordinate displayed properly in the app, check to see what is different about the Share Point columns between the start and stop. What is the number of decimal places set to?

 

PS. On a different note. If you prefer, you can set both context variables in one declaration instead of two.

UpdateContext({var_currentLat: Location.Latitude, var_currentLong: Location.Longitude})

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,250)