Rabih Sarieddine
Rabih Sarieddine

Reputation: 161

Xamarin - IOS - CLLocationManager: get location updates when iphone is locked or sleeping

i am trying to find this information but so far i am unsuccessful. I know that the CLLocationManager has background capabilities. It is pretty well documented. I would like to know if the CLLocationManager is configured properly for backgrounding, will it trigger standard location updates even when the phone is locked and sleeping? and if yes, suppose that my application is not killed, does it wake it up? can i execute code to handle the location fix? I can do the test but i am afraid that my lack of knowledge will give me wrong or incomplete conclusions. This is why i am asking the community.

thanks for your time

Upvotes: 0

Views: 610

Answers (2)

Bikash
Bikash

Reputation: 368

LocationManager = new CLLocationManager();
LocationManager.AllowsBackgroundLocationUpdates = true;

You have AllowsBackgroundLocationUpdates to true to get it working in sleep or in background mode.

Upvotes: 3

David S.
David S.

Reputation: 6705

  1. Yes it can run in the background.
  2. Yes if you run it in the background it will wake your app for 30 seconds.

Upvotes: 0

Related Questions