After upgrading the Location Plugin and generating with MABS 11 we experience a very significant drop in performance with the GetLocation client action. It typically takes a couple of seconds for the client action to execute. Before, it was too short for users to notice.
The GetLocation is used in a screen where a spinner is shown until all data is loaded, which is why we noticed the sudden decrease in performance.
Please advise how we can get performance back the previous level.
Hi Dylan and Thomas,
Did you add the necessary iOS permission descriptions to the app's extensibility configurations? This was a breaking change we added in the plugin's latest version, as stated in the plugin's official documentation page.
Once you add those, GetLocation should work properly on iOS.
Best regards,
Alexandre Jacinto
Hey Thomas, sorry to hear that you're experiencing issues with the Location Plugin.
Can you take a screenshot of how are you calling GetLocation client action, i.e. what parameter values are you passing?
Furthermore, are you noticing this longer delay for any particular platform? Native Android app, iOS, PWA?
Hi @Thomas Skødt ,Is this happening in Android, iOS, or both?Best regards,
Hi Pedro and Alexandre
Thank you for your quick response.
We only generate this app for iOS. The GetLocation action is used in a client action, which is in turn called from a screen action in a block.
I have attached a screenshot of the client action with the parameters.
Hi again @Thomas Skødt,
We tested version 6.0.0 on our side in an iOS app, and we didn't notice a drop of performance when comparing to the previous version. In fact, in our tests, when calling the GetLocation action, the location is returned almost immediately.Please note that the time it takes for the GetLocation action to return may vary due to device conditions like Wi-Fi, cellular signal, and GPS signal.
Could you share an .OAP of your application where you're noticing this drop in performance? Also, did you do the exact same test with the same device using the two different versions of the Location plugin (6.0.0 and 5.2.4) ?
Best regards,Alexandre Jacinto
Hi Alexandre,
Yes, we only did the upgrade in our dev environment, so we compared the performance with our test environment, which has version 5.2.1 and was generated using MABS 10.
Our app oap is 7.2MB, so please advise a different way of sharing the oap with you.
Regards,
Thomas
Hi Thomas!
Could you maybe create a simple application that only calls the GetLocation client action, and test it with both versions of the plugin, to see if there's a difference?
The idea here is to use a very simple app with no other logic, so we can focus solely on the GetLocation client action.Best regards,Alexandre Jacinto
We can try that. I will look into that on Monday and get back to you.
BR, Thomas
Hi Alexandre,We noticed this issue as well (we're on MABS 11) and encountered the following error:"OS-PLUG-GLOC-0010 Could not obtain location in time. Try with a higher timeout."Even when setting up a new application that only calls GetLocation, we experience the same issue it times out after about 5 seconds.However, when we downgrade to the following version:"url": "https://github.com/OutSystems/cordova-plugin-geolocation#4.0.1-OS14","metadata": { "mabs-min": "10.0.0", "name": "Location Plugin", "version": "5.2.4"}it works without any issues.It seems that the problem is related to this version:"url": "https://github.com/ionic-team/cordova-outsystems-geolocation.git#1.0.0","metadata": { "mabs-min": "10.0.0", "name": "Location Plugin", "version": "6.0.0"}CheersDylan
Hi Dylan,
Can you show how you're calling the GetLocation client action? What are the parameters you're using? By default, there's a timeout of 5 seconds, but you can change this parameter to be whatever you'd like.
Hi Alexandre,I'm using default values but even setting it to 10 or 15 seconds the result is still the same.It's just a test app that outputs all values to the screen
Btw this is on IOS
Testing with your sample app for the Location Plugin, everything is working as expected.
Could you share the .OAP of that test app so I can test it on my end?
Sure, here's the OAP
P.S Seems to work OK in android studio emulator but when using it on my physical IOS device it fails
Aha! Thanks for that Alexandre!
We did not do that either, so that is the reason.
Thank you, Alexandre!
Glad to have been able to help.
Please don't hesitate to contact again if you have any further questions.
We are experiencing the same issue while using a minimal app dedicated to retrieving location.
It takes a long time to obtain the location, and we frequently encounter timeouts.
We have tested with Maps 10 and 11, but the results remain the same. The issue occurs on both iOS and Android.
We have configured extensibilities with NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription.
However, reverting to a previous version of the location plugin resolves the issue.
Hi Pedro!Can you please show how you're calling the GetLocation client action? What input parameters are being passed?
Hello Alexandre:
Here it is:
Can you experiment with different values for Timeout and MaximumAge?
Using higher values should result in less timeouts.
the older version is faster than this one.
If i set the timeout to 30 seconds it fails less but the older version does not need high timeouts to get location.
Until the performance its fixed we will use the older version.
Hi Pedro,We released a new version of the Location Plugin (6.0.2 on O11 and 2.0.4 on ODC) that fixes an issue we had with GetLocation and WatchPosition for iOS.Are you still facing issues on Android?
another example with an android device
I just updated my location plugin and am getting the same problem as well. So I will also be reverting my plugin back to the previous version.
Just to add onto this one.
On iOS, I found that if I used the Watch Position widget/calls and then later triggered a GetLocation request (since iOS often doesn't return a location unless the device is moving), the GetLocation would fail with a timeout in about 9 out of 10 cases.
This timeout issue also seemed to negatively impact the Watch Position widget, preventing it from receiving updates for a while.
So I removed all instances of the Watch Position widget/calls. Since doing that, I'm able to trigger as many GetLocations requests as needed. While not ideal it'll do for now.I tried quite a few setups on a test screen with WatchPosition but it just doesn't want to behave with GetLocation at all.
@Dylan Evans I recently updated my plugin because of the bug fix stating an issue was fixed where it wasn't working returning from the background. But since doing this update I have the same problem. The WatchPosition and GetLocation do not work well together at all. They are causing timeouts.
Hi Spencer, Sorry to hear you're having trouble with the plugin.
This is on iOS right? Did you add the necessary iOS permission descriptions to the app's extensibility configurations?
I have yes. At least I think that I did it right.
It does look like it. So if you test the app on a fresh install, the first time you call GetLocation or WatchPosition, the permission for the location is requested correct?
Correct
Hi @Spencer Buhler and @Dylan Evans,We released a new version of the Location Plugin (6.0.2 on O11 and 2.0.4 on ODC) that should fix the issue with WatchPosition interfering with GetLocation.Please do let us know if there is anything else we can help with.Best regards,Alex Jacinto
@Alexandre Jacinto appreciate it, I'll check it out!