breautek commented on issue #257:
URL: 
https://github.com/apache/cordova-plugin-geolocation/issues/257#issuecomment-1883740721

   > Has anyone found a fork out there with this fix or have any idea how to 
solve this? I have an app update being blocked from release at Apple because of 
this. I hope I don't have to do a full re-write...
   
   Not aware of any forks but a rewrite shouldn't be necessary. The warning is 
caused by some APIs that checks states on the location manager, which may block 
for a long time so it isn't desirable to call on the main thread. If it does 
block for a significant of time, it will make hte app unresponsive since it 
will block UI updates. So the solution is to not call on those checks on the 
main thread.
   
   However it's not as trivial as simply wrapping the code in a background 
block. The CLLocationManager instance is only safe to use on the 
thread/dispatch queue it was created in.
   
   So the solution is probably to create a dispatch queue for geolocation usage 
and have the CLLocationManager initialized in that queue, as well as any 
cordova calls to switch to that queue when performing location manager calls. 
And of course to return back to the main queue when calling back to the webview.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to