Error class

code ErrorCodes.locationPermissionDenied

  • type: ErrorType.critical.

  • CAUSE: Location permissions were not granted yet, so SDK won't be able to start positioning. The permissions needed to fix this error are:

    • ACCESS_FINE_LOCATION (Android)
    • NSLocationWhenInUseUsageDescription (iOS)

code ErrorCodes.bluetoothPermissionDenied

  • Android only.

  • type: ErrorType.critical.

  • CAUSE: BLUETOOTH_CONNECT or BLUETOOTH_SCAN are not granted yet, so SDK won't be able to start positioning.

code ErrorCodes.bluetoothDisabled

  • type: ErrorType.critical for iOS but ErrorType.nonCritical for Android.

  • CAUSE: The bluetooth sensor of the device is off, so iOS will stop positioning and Android won't give a precise location as with this sensor on.

code ErrorCodes.locationDisabled

  • type: ErrorType.critical.

  • CAUSE: The location service is disabled, so SDK won't be able to start positioning.

code ErrorCodes.foregroundServiceNotAllowed

  • Android only.

  • type: ErrorType.critical.

  • CAUSE: The positioning could not start because the Android Foreground Service where it runs tried to start in an illegal state. On Android 12+ (API level 31 and above), apps are generally restricted from starting Foreground Services while running in the background, except in certain specific exemptions. If you try to start the Situm Foreground Service from the background, the SDK will capture the Operating System exception and will throw this error. As a consequence, the positioning will not be started. Solution: Start positioning only when the app is in the foreground.

There are other errors that we throw directly as we receive them from Android and iOS.

Constructors

Error({required String code, required String message, required ErrorType type})
const

Properties

code String
final
hashCode int
The hash code for this object.
no setterinherited
message String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type ErrorType
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

bleDisabledError() Error