-
Notifications
You must be signed in to change notification settings - Fork 359
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
IOS: Does not ask for location permission. #50
Comments
The library does not ask for permissions. Permissions should be asked in the main app(for example package location_permissions/location_permissions. |
Yes i do. see my code: @override
Widget build(BuildContext context) {
if (!isRunning && isBackgroundActive) {
_checkLocationPermission();
}
return OKToast(
duration: Duration(seconds: Helpers.toastDuration),
position: ToastPosition.bottom,
handleTouth: true,
dismissOtherOnShow: true,
child: Visibility(
visible: (linkFetch == true),
...
void _checkLocationPermission() async {
final access = await LocationPermissions().checkPermissionStatus();
switch (access) {
case PermissionStatus.unknown:
case PermissionStatus.denied:
case PermissionStatus.restricted:
final permission = await LocationPermissions().requestPermissions(
permissionLevel: LocationPermissionLevel.locationAlways,
);
if (permission == PermissionStatus.granted) {
_startLocator();
} else {
// show error
}
break;
case PermissionStatus.granted:
_startLocator();
break;
}
}
void _startLocator() {
BackgroundLocator.registerLocationUpdate(
LocationBackground.callback,
androidNotificationCallback: LocationBackground.notificationCallback,
settings: LocationSettings(
notificationTitle: "My App",
notificationMsg: "My App Title",
notificationIcon: 'ic_background',
wakeLockTime: 20,
autoStop: false,
interval: 60 * 5, // 5 minutes (300 secs)
),
);
setState(() {
isRunning = true;
});
} It works on android, and ask for permission... see: But in iOS do not ask for permission, and the location permission is missing in permission list in app detail. See here: |
Did you followed the instruction for setting up on iOS ? You have to add location permission in |
Yes i do! When i opened this post i add the Info.plist portion that has backgrond location settings... I thing i do not miss any setting... |
Did you try running exactly the "example" from this repository? The Info.plist configuration looks good, but maybe there is something that the configuration is different. |
Works the example and works... weird... will investigate if something is missing here on my project. But, in the repo "example" project is causing the same problem of this issue #55 (comment)_ |
try with the previous version of the repo, maybe there is something in the configuration that is missing (in that case better the documentation). Then we go back to the latest version of the library and wait to solve the bug |
I have the same issue |
Aaaaah! It is the App Target! NSLocationAlwaysUsageDescription is for IOS 10+ I had IOS 8 set and removing this fixed the issue. But then also changing my target fixed it also. |
I think this problem is fixed, so I'm closing this issue, but feel free to open it anytime; |
Fix callback in release build (rekabhq#50)
Hello.
It's working fine on Android. But on iOS it not asks for permission and of course, not works.
See app permission... not have location permissions:
Do i miss something???
Below my files as oriented in documentation:
AppDelegate.swift
Info.plist
Runner settings
The text was updated successfully, but these errors were encountered: