AppState

@objcMembers
public class AppState : NSObject
extension AppState: JsonString

Details about current state of the application

  • Current Battery level of the device. 0 .. 1.0. -1.0 if UIDeviceBatteryStateUnknown

    Declaration

    Swift

    public let batteryLevel: Decimal
  • Whether Bluebar mode (aka Background Location Access) is enabled or not. See out Documentation for mode details: https://docs.bluedot.io/ios-sdk/ios-features/blue-bar/

    Declaration

    Swift

    public let blueBarEnabled: Bool
  • When rules were last downloaded from Canvas

    Declaration

    Swift

    public let lastRuleDownload: Date?
  • Location permission status. Available values: [always, while_using, denied, not_determined, restricted, unknown]

    Declaration

    Swift

    public let locationPermission: String
  • Notification permission status. Available values: [authorized, provisional, ephemeral, not_determined, denied, unknown]

    Declaration

    Swift

    public let notificationPermission: String
  • Application View status. Available values: [foreground, background]

    Declaration

    Swift

    public let viewState: String
  • Convert to JSON string

    This function throws an error if JSON encoding process fails

    Declaration

    Swift

    @objc(toJson:)
    public func toJson() throws -> String