locationManager DidChangeAuthorization

Strange problem with Location second call.

  1. Assigning Runtime: addEventListener
  2. Removing Runtime: removeEventListener
  3. Seems like it’s ok. But!
  4. Assigning Runtime: addEventListener
  5. Here goes the console output (iOS 16 / iPhone 11, v 2022.3683) :
Device] Mapping the pipeline data cache failed, errno 22
Nov 08 03:41:18.043 [Device] {"msg":"CLClientIsLocationServicesEnabled", "event":"activity"}
Nov 08 03:41:18.043 [Device] This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the `-locationManagerDidChangeAuthorization:` callback and checking `authorizationStatus` first.

@vlads @Scott_Harrison , any ideas what’s that?

Can you provide a code snippet, I am kind of puzzled on what happening?

Hey Scott,
I’ve tried to set up location event listener. First try is ok, but if you remove listener and then add it back - there goes CLClientIsLocationServicesEnabled stuff.
Seems like it’s all about this.
Let me know your thoughts.

Is there a crash or break when you do this?

No, no crash at all. But I can’t get updates from location listener, it become forbidden after then.

@Scott_Harrison,

I would really like this method to work properly. My project involves frequent access to the GPS, but it makes no sense to keep it on all the time. If there was an option to use the old location request method, it would be very nice.

Now I plan to get around this situation by creating a global object that will listen to changes in geolocation, and hang the necessary handlers on it every time different interfaces are activated.

But, again, if in some magical way you manage to fix it all, it would be frankly great.
I know you are the magician :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.