Do extras set via setConfig survive .ready() if the ready() config omits PersistenceConfig? #1708
|
Plugin version: 5.0.3 I set the extras at runtime like this: await BackgroundGeolocation.setConfig(Config(
persistence: PersistenceConfig(extras: {'foo': 'bar'}),
));We need these values to persist between app launches after .ready is called. Given this use case will omitting PersistenceConfig from .ready config param persist these values or will they still be overridden? I just want to know if this is possible or should I handle the persistence of these values myself |
Replies: 1 comment
|
Yes, it's possible with BackgroundGeolocation.ready(Config(
reset: false
.
.
.
));Your This is exactly how the Warning: with |
Yes, it's possible with
reset: false:Your
Configwill be consumed only at the first install of your app. Thereafter, to change config, you can only do so via.setConfig.This is exactly how the
/exampleapp I use for field-testing works, which contains a complex "Settings" screen that I use for driving the config. When I change something likedistanceFilter, orstopOnTerminatevia UI screen, I want those settings to persist and not have my defaultConfigconsumed each time.ready(config)is called.Warning: with
reset: false, tweaks to yourConfigsupplied to.ready(config)will be ignored on an already installed app.