0

I am using GeoLocator package (version 9.0.2). I am able to get the location as long as the app is in foreground with the permission set to "While Using the App". As soon as the app goes in the background the location stops working and I get the following error:

LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 1.)

I have enabled 'Location updates' in Background Modes Capability in Xcode. (https://github.com/Baseflow/flutter-geolocator/issues/948) enter image description here

When permission is set to 'Always', I am able to get location as long as the phone's screen is on even when the app is in background. As soon as phone goes black/locked mode the location stops updating and have to open the app again for the process to start again.

What can I try next?

halfer
  • 19,824
  • 17
  • 99
  • 186
Saad Bashir
  • 4,341
  • 8
  • 30
  • 60
  • You need to take `Always Allow` permission in IOS. – Harsh Sureja Mar 28 '23 at 08:21
  • An app is considered "in use" when you’re actively using it in the foreground, or when it is using location in the background, in which case a blue pill will display in your status bar. Source: https://support.apple.com/en-us/HT203033 – Saad Bashir Mar 28 '23 at 08:38

0 Answers0