Android only params

This commit is contained in:
Anton Tananaev 2026-02-22 14:43:12 -08:00
parent 6e3532f9fd
commit 9ba5716e35

View file

@ -72,28 +72,33 @@ class Preferences {
_ => bg.DesiredAccuracy.medium, _ => bg.DesiredAccuracy.medium,
}, },
distanceFilter: isHighestAccuracy ? 0 : instance.getInt(distance)?.toDouble(), distanceFilter: isHighestAccuracy ? 0 : instance.getInt(distance)?.toDouble(),
locationUpdateInterval: isHighestAccuracy ? 0 : (locationUpdateInterval > 0 ? locationUpdateInterval : null), locationUpdateInterval: Platform.isAndroid
fastestLocationUpdateInterval: isHighestAccuracy ? 0 : fastestLocationUpdateInterval, ? (isHighestAccuracy ? 0 : (locationUpdateInterval > 0 ? locationUpdateInterval : null))
: null,
fastestLocationUpdateInterval: Platform.isAndroid ? (isHighestAccuracy ? 0 : fastestLocationUpdateInterval) : null,
disableElasticity: true, disableElasticity: true,
pausesLocationUpdatesAutomatically: Platform.isIOS ? !(isHighestAccuracy || instance.getBool(stopDetection) == false) : null, pausesLocationUpdatesAutomatically: Platform.isIOS ? !(isHighestAccuracy || instance.getBool(stopDetection) == false) : null,
showsBackgroundLocationIndicator: false, showsBackgroundLocationIndicator: false,
), ),
app: bg.AppConfig( app: bg.AppConfig(
enableHeadless: true, enableHeadless: Platform.isAndroid ? true : null,
stopOnTerminate: false, stopOnTerminate: false,
startOnBoot: true, startOnBoot: Platform.isAndroid ? true : null,
heartbeatInterval: heartbeatInterval > 0 ? heartbeatInterval.toDouble() : null, heartbeatInterval: heartbeatInterval > 0 ? heartbeatInterval.toDouble() : null,
preventSuspend: heartbeatInterval > 0, preventSuspend: Platform.isIOS ? (heartbeatInterval > 0) : null,
backgroundPermissionRationale: bg.PermissionRationale( backgroundPermissionRationale: Platform.isAndroid
title: 'Allow {applicationName} to access this device\'s location in the background', ? bg.PermissionRationale(
message: 'For reliable tracking, please enable {backgroundPermissionOptionLabel} location access.', title: 'Allow {applicationName} to access this device\'s location in the background',
positiveAction: 'Change to {backgroundPermissionOptionLabel}', message: 'For reliable tracking, please enable {backgroundPermissionOptionLabel} location access.',
negativeAction: 'Cancel' positiveAction: 'Change to {backgroundPermissionOptionLabel}',
), negativeAction: 'Cancel')
notification: bg.Notification( : null,
smallIcon: 'drawable/ic_stat_notify', notification: Platform.isAndroid
priority: bg.NotificationPriority.low, ? bg.Notification(
), smallIcon: 'drawable/ic_stat_notify',
priority: bg.NotificationPriority.low,
)
: null,
), ),
http: bg.HttpConfig( http: bg.HttpConfig(
autoSync: false, autoSync: false,