SystemService

public enum SystemService: CustomStringConvertible

Enum describing various system services such as geo-location, local notifications, CoreMotion and HealthKit.

The items have a usageReason attached to them which can be shown to users for explanation when requesting access. There’s also a localizedHowToReEnable string that instructs users on how to re-enable the respective service.

  • Access to the user’s location while using the app. Must provide the reason why you want access.

    Declaration

    Swift

    case geoLocationWhenUsing(String)
  • Access to the user’s location even when in background. Must provide the reason why you want access here and set NSLocationAlwaysUsageDescription in Info.plist

    Declaration

    Swift

    case geoLocationAlways(String)
  • Permission to deliver local notifications.

    Declaration

    Swift

    case localNotifications(Set<UIUserNotificationCategory>)
  • Permission to access CoreMotion data.

    Declaration

    Swift

    case coreMotion
  • Permission to use HealthKit data. Provide NSHealthShareUsageDescription and/or NSHealthUpdateUsageDescription in Info.plist.

    Declaration

    Swift

    case healthKit(HealthKitTypes)
  • Permission to access the device microphone.

    Declaration

    Swift

    case microphone
  • The title or name of the service.

    Declaration

    Swift

    public var description: String
  • The description of what the service entails/why it’s needed.

    Declaration

    Swift

    public var usageReason: String
  • Localized instructions telling how to re-enable the system service. Queries CFBundleDisplayName from the bundle’s Info.plist to substitute the app name.

    Declaration

    Swift

    public var localizedHowToReEnable: String
  • Whether the settings can be managed from within the app’s settings pane (not a top-level pane, such as “Privacy”)

    Declaration

    Swift

    public var wantsAppSettingsPane: Bool