# MoveServiceWarning

{% tabs %}
{% tab title="Android" %}

```kotlin
data class MoveServiceWarning(
    val service: MoveDetectionService,
    val warnings: List<MoveWarning>
)
    
sealed class MoveWarning {

    object ActivityPermissionMissing : MoveWarning()
    object BackgroundLocationPermissionMissing : MoveWarning()
    object BluetoothPermissionMissing : MoveWarning()
    object EnergySaver : MoveWarning()
    object LocationMode : MoveWarning()
    object MockProvider : MoveWarning()
    object MockProviderLocation : MoveWarning()
    object BatteryOptimization : MoveWarning()
    object GpsOff : MoveWarning()
    object Offline : MoveWarning()
    object NoSim : MoveWarning()
    object Rooted : MoveWarning()
    object GoEdition : MoveWarning()
    object PlayServicesMissing : MoveWarning()
    object BackgroundRestricted : MoveWarning()
    object GooglePlayLocationAccuracyMissing : MoveWarning()
    object NotificationPermissionMissing : MoveWarning()
    class LocationPowerMode(val mode: Int) : MoveWarning()
    object BluetoothTurnedOff : MoveWarning()
    object BluetoothScanPermissionMissing : MoveWarning()
    object BluetoothConnectPermissionMissing : MoveWarning()
    object FineLocationPermissionMissing : MoveWarning()
    object NotificationMissing : MoveWarning()
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
struct MoveServiceWarning {
    enum Reason {
        case missingPermission([MovePermission])
    }

    var service: MoveConfig.DetectionService
    var reason: Reason
}

enum MovePermission: Int {
    case location
    case backgroundLocation
    case preciseLocation
    case motionActivity
    case gyroscope
    case accelerometer
    case bluetooth
    case bluetoothScan
}
```

{% endtab %}

{% tab title="React Native" %}

```typescript
export type WarningReasons =
  | 'BACKGROUND_LOCATION_PERMISSION_MISSING'
  | 'MOTION_PERMISSION_MISSING'
  | 'ACTIVITY_PERMISSION_MISSING'
  | 'BATTERY_OPTIMIZATION'
  | 'BLUETOOTH_TURNED_OFF'
  | 'BLUETOOTH_SCAN_PERMISSION_MISSING'
  | 'BLUETOOTH_CONNECT_PERMISSION_MISSING'
  | 'GOOGLE_PLAY_LOCATION_ACCURACY_MISSING'
  | 'NOTIFICATION_PERMISSION_MISSING'
  | 'FINE_LOCATION_PERMISSION_MISSING'
  | 'BLUETOOTH_PERMISSION_MISSING' 
  | 'NOTIFICATION_MISSING'
  | 'GO_EDITION'
  | 'ROOTED'
  | 'NO_SIM'
  | 'BACKGROUND_RESTRICTED'
  | 'MOCK_PROVIDER_LOCATION'
  | 'MOCK_PROVIDER'
  | 'LOCATION_MODE'
  | 'PLAY_SERVICES_MISSING'
  | 'LOCATION_POWER_MODE(0)'
  | 'LOCATION_POWER_MODE(1)'
  | 'LOCATION_POWER_MODE(2)'
  | 'LOCATION_POWER_MODE(3)'
  | 'LOCATION_POWER_MODE(4)'
  | 'ENERGY_SAVER';

export type IssueListService =
  | TimelineDetectionService
  | DrivingService
  | WalkingService;

export type IssueListItem<ReasonsType> = {
  reasons: Array<ReasonsType>;
  service?: IssueListService;
};

export type WarningListType = Array<IssueListItem<WarningReasons>>;
```

{% endtab %}

{% tab title="Flutter" %}

```dart
import 'package:movesdk/io/dolphin/move/move_service_warning.dart';
```

```dart
class MoveServiceWarning {
  final MoveDetectionService? service;
  final List<MoveWarning> reasons;
}
```

```dart
enum MoveWarning {
  activityPermissionMissing,
  backgroundLocationPermissionMissing,
  backgroundRestricted,
  batteryOptimization,
  bluetoothConnectPermissionMissing,
  bluetoothPermissionMissing,
  bluetoothScanPermissionMissing,
  bluetoothTurnedOff,
  energySaver,
  fineLocationPermissionMissing,
  goEdition,
  googlePlayLocationAccuracyMissing,
  gpsOff,
  locationMode,
  locationPowerMode,
  mockProvider,
  mockProviderLocation,
  noSim,
  notificationPermissionMissing,
  offline,
  playServicesMissing,
  rooted,
  notificationMissing,
}
```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="206" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><strong>Field</strong></td><td></td></tr><tr><td align="center">service</td><td>see <code>MoveDetectionService</code> in <a href="moveconfig">MoveConfig</a></td></tr><tr><td align="center">reason</td><td>List of optional <code>MoveServiceWarning</code></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="206" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><strong>LocationPowerMode</strong></td><td></td></tr><tr><td align="center">0</td><td>Either the location providers shouldn't be affected by battery saver or battery saver is off.</td></tr><tr><td align="center">1</td><td>In this mode, the GPS based location provider should be disabled when battery saver is on and the device is non-interactive.</td></tr><tr><td align="center">2</td><td>All location providers should be disabled when battery saver is on and the device is non-interactive.</td></tr><tr><td align="center">3</td><td>In this mode, all the location providers will be kept available, but location fixes should only be provided to foreground apps.</td></tr><tr><td align="center">4</td><td>In this mode, location will not be turned off, but LocationManager will throttle all requests to providers when the device is non-interactive.</td></tr></tbody></table>
