Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: iOS background doesn't work (kCLErrorDomain error 1) #1539

Closed
3 of 8 tasks
jupeng123 opened this issue Jul 8, 2024 · 10 comments
Closed
3 of 8 tasks
Assignees
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.

Comments

@jupeng123
Copy link

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Your question

final locationSettings = AppleSettings(
activityType: ActivityType.fitness,
showBackgroundLocationIndicator: true,
allowBackgroundLocationUpdates: true,
);

final sub =
    LocationUtils.getPositionStream(locationSettings: locationSettings).listen((event) {}, onError: (error) {
  print('=======$error');
});

background is enable

info
NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription

Flutter 3.19.5
Tools • Dart 3.3.3 • DevTools 2.31.1

Version

12

@TimHoogstrate
Copy link
Contributor

Dear @jupeng123,

What type of permission have you requested? Could it be related to this issue? And can you check if this works in the example app?

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Jul 18, 2024
@jupeng123
Copy link
Author

Dear @jupeng123,

What type of permission have you requested? Could it be related to this issue? And can you check if this works in the example app?

Kind regards,

static Future handleLocationPermission({bool checkService = true}) async {
if (checkService) {
final serviceFlag = await serviceEnabled();
if (!serviceFlag) {
return false;
}
}

LocationPermission permission;
permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied) {
  permission = await Geolocator.requestPermission();
  if (permission == LocationPermission.denied) {
    return false;
  }
}
if (permission == LocationPermission.deniedForever) {
  return false;
}

return true;

}

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Jul 18, 2024
@TimHoogstrate
Copy link
Contributor

Dear @jupeng123,

I asked another question. Are you able to reproduce it with the example app?

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 5, 2024
@jupeng123
Copy link
Author

Dear @jupeng123,

I asked another question. Are you able to reproduce it with the example app?

Kind regards,
20240805-174458

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Aug 5, 2024
@jupeng123
Copy link
Author

Location permission has been granted

@TimHoogstrate
Copy link
Contributor

kCLErrorDomain Code 1 occurs when the user has denied your app access to location services. Please check if you have the correct permissions for background locations on iOS. Also try if it is happening with the example app. Also are you testing this on a real iOS device? Because your screenshot does not look like default iOS.

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 7, 2024
@TimHoogstrate TimHoogstrate self-assigned this Aug 7, 2024
@jupeng123
Copy link
Author

kCLErrorDomain Code 1 occurs when the user has denied your app access to location services. Please check if you have the correct permissions for background locations on iOS. Also try if it is happening with the example app. Also are you testing this on a real iOS device? Because your screenshot does not look like default iOS.

Kind regards,

Location permissions are all enabled

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Aug 8, 2024
@jupeng123
Copy link
Author

kCLErrorDomain Code 1 occurs when the user has denied your app access to location services. Please check if you have the correct permissions for background locations on iOS. Also try if it is happening with the example app. Also are you testing this on a real iOS device? Because your screenshot does not look like default iOS.

The device is an iPhone, and location services and permissions are enabled

@TimHoogstrate
Copy link
Contributor

TimHoogstrate commented Aug 19, 2024

Dear @jupeng123,

Did you try to run this in the example app? Can you check if the location services are enabled in : Settings > Privacy > Location Services > Your App.

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 19, 2024
@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Aug 19, 2024
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 20, 2024
Copy link

github-actions bot commented Sep 3, 2024

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Sep 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.
Projects
None yet
Development

No branches or pull requests

2 participants