I have been using WL.Device.Geo.acquirePosition for few weeks now. And I've been constantly experiencing its inconsistency. The code works, but for some time it would suddenly not work anymore. There's no error. It just does not execute the WL.Device.Geo.acquirePosition code. The work around would usually be shutting down the computer for a while, and after rebooting again, it would work. I'm using worklight 6.2 by the way. And I'm running my app on an iOS Device. Is there any proper fix for this? Thank you.
Asked
Active
Viewed 238 times
0
-
1Could you please share the options you are passing in and how you are handling errors in your onFailure callback? – MotiNK Sep 30 '14 at 18:28
-
Here is my onFailure callback: function(geoErr) {alertOnGeoAcquisition(geoErr); getFirstPositionAndTrack();} However, neither the onSuccess function or the onFailure function is being called. So, I was assuming that acquirePosition function is not being executed. – AWSSET Oct 02 '14 at 07:01
-
1Can you share the options you are passing in? What is your options.timeout and options.maximumAge? – MotiNK Oct 02 '14 at 07:59
-
i did not set the timeout. maximumAge is 10000. Is timeout required? – AWSSET Oct 02 '14 at 10:16
1 Answers
1
If you don't specify a timeout it is effectively equivalent to an infinite timeout (this is consistent with the w3c spec); this can mean that it can keep waiting to try and acquire without failing for very long periods of time. Please specify a timeout and see that the onFailure function is called with an appropriate error code.

MotiNK
- 421
- 2
- 12