Closed solid-vovabeloded closed 5 years ago
Thanks, I see the problem in the else
clause:
+(UIAlertController*) getAlertController
{
TSConfig *config = [TSConfig sharedInstance];
NSDictionary *strings = [config getLocationAuthorizationAlertStrings];
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
NSString *title = (status == kCLAuthorizationStatusDenied) ? strings[@"titleWhenOff"] : strings[@"titleWhenNotEnabled"];
if (!alertController) {
alertController = [UIAlertController alertControllerWithTitle:title message:strings[@"instructions"] preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:strings[@"cancelButton"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) {
[self hide];
}];
[alertController addAction:cancelAction];
UIAlertAction* settingsAction = [UIAlertAction actionWithTitle:strings[@"settingsButton"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) {
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:settingsURL];
}];
[alertController addAction:settingsAction];
} else {
// alertController instance already exists here.
// TODO Need to fetch references to the buttons here and update their text.
[alertController setTitle:title];
[alertController setMessage:strings[@"instructions"]];
}
return alertController;
}
Carry on with your testing. This will be fixed soon.
@christocracy any way this can be fixed today/tomorrow? we need to make sure that languages are ok before pushing to the App Store and this issue is one of few remaining.
any updates on this?
In the meantime, you can always disableAuthorizationAlert and implement your own alert in the onProviderChange
event.
I've tried this approach recently and it is not working correctly. onProviderChange event triggers only after changing settings, but not after plugin initialization and thus we cannot show alert directly after plugin initialization like default alert message.
Listen to onProviderChange
before #ready
.
#ready
causes a providerchange
event to fire. If you're not listening to the event before #ready
, you'll miss the event.
I've checked this one. And it doesn't work too. #ready does not make onProviderChange event to fire even if I add this listener before #ready method
@vova-beloded Show me your code where you're executing #ready
and #onProviderChange
bgGeolocation.BackgroundGeolocation.onProviderChange((providerChange) {
print('on provider change');
});
Map deviceParams = await bgGeolocation.Config.deviceParams;
print('ready');
await bgGeolocation.BackgroundGeolocation.ready(bgGeolocation.Config(
reset: true,
disableLocationAuthorizationAlert: true,
desiredAccuracy: bgGeolocation.Config.DESIRED_ACCURACY_HIGH,
distanceFilter: 10.0,
stopOnTerminate: false,
stationaryRadius: 5.0,
startOnBoot: true,
isMoving: true,
foregroundService: true,
notificationTitle: "xxx",
notificationText: "xxx",
stopTimeout: 1,
debug: true,
autoSync: true,
url: 'http://tracker.transistorsoft.com/locations/vova-beloded',
params: deviceParams,
logLevel: bgGeolocation.Config.LOG_LEVEL_OFF));
print('ready done');
I see you viewing /locations/username in the browser.
It’s just /username
locationAuthorizationAlert
Should be fixed in 0.1.7
Confirmation please.
@vova-beloded Confirmation please.
confirmed
In the meantime, you can always disableAuthorizationAlert and implement your own alert in the
onProviderChange
event.
I was looking for a property to disable built-in authorization alert and see I found it.
Your Environment
flutter doctor
):Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.4 17E199, locale en-UA) [✓] Android toolchain - develop for Android devices (Android SDK 28.0.3) [✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1) [✗] Android Studio (not installed) [✓] IntelliJ IDEA Ultimate Edition (version 2018.2.4) [✓] Connected devices (1 available)
! Doctor found issues in 1 category.
Expected Behavior
The authorization alert message should fully update every time plugin configuration updated
Actual Behavior
titleWhenNotEnabled, titleWhenOff, instructions fields updated successfully, but cancelButton and settingsButton does not update until application restart
Steps to Reproduce
Modify example app:
Context
We are trying to localize our app using intl_helpers plugin but this bug makes impassable to translate this message, because some values not changing