Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

SDLLockScreenConfiguration Class Reference

Section Contents

Overview

A configuration describing how the lock screen should be used by the internal SDL system for your application. This configuration is provided before SDL starts and will govern the entire SDL lifecycle of your application.

displayMode

Describes when the lock screen will be displayed. Defaults to SDLLockScreenConfigurationDisplayModeRequiredOnly.

Objective-C

@property (assign, readwrite, nonatomic)
    SDLLockScreenConfigurationDisplayMode displayMode;

Swift

var displayMode: SDLLockScreenConfigurationDisplayMode { get set }

showInOptionalState

Whether or not the lock screen should be shown in the lock screen optional state. Defaults to NO.

In order for the lock screen optional state to occur, the following must be true:

  1. The app should have received at least 1 driver distraction notification (i.e. a OnDriverDistraction notification) from SDL Core. Older versions of Core did not send a notification immediately on connection.
  2. The driver is not distracted (i.e. the last OnDriverDistraction notification received was for a driver distraction state off).
  3. The hmiLevel can not be NONE.
  4. If the hmiLevel is currently BACKGROUND then the previous hmiLevel should have been FULL or LIMITED (i.e. the user should have interacted with app before it was backgrounded).

Since this has been deprecated, setting this to true will set displayMode to OptionalOrRequired if enableAutomaticLockScreen is true, or will have no effect if it is false.

Objective-C

@property (assign, readwrite, nonatomic) BOOL showInOptionalState;

Swift

var showInOptionalState: Bool { get set }

enableDismissGesture

If YES, then the lock screen can be dismissed with a downward swipe on compatible head units. Requires a connection of SDL 6.0+ and the head unit to enable the feature. Defaults to YES.

Objective-C

@property (assign, readwrite, nonatomic) BOOL enableDismissGesture;

Swift

var enableDismissGesture: Bool { get set }

If YES, then the lockscreen will show the vehicle’s logo if the vehicle has made it available. If NO, then the lockscreen will not show the vehicle logo. Defaults to YES.

Objective-C

@property (assign, readwrite, nonatomic) BOOL showDeviceLogo;

Swift

var showDeviceLogo: Bool { get set }

enableAutomaticLockScreen

If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged. Defaults to YES.

Since this has been deprecated, setting this to false will set displayMode to Never. Setting it back to true will set it to RequiredOnly if showInOptionalState is false, or OptionalOrRequired if it is true.

Objective-C

@property (readonly, assign, nonatomic) BOOL enableAutomaticLockScreen;

Swift

var enableAutomaticLockScreen: Bool { get }

backgroundColor

The background color of the lock screen. This could be a branding color, or leave at the default for a dark blue-gray.

Objective-C

@property (readonly, copy, nonatomic) UIColor *_Nonnull backgroundColor;

Swift

@NSCopying var backgroundColor: UIColor { get }

appIcon

Your app icon as it will appear on the lock screen.

Objective-C

@property (readonly, copy, nonatomic, nullable) UIImage *appIcon;

Swift

@NSCopying var appIcon: UIImage? { get }

customViewController

A custom view controller that the lock screen will manage the presentation of.

Objective-C

@property (readonly, strong, nonatomic, nullable)
    UIViewController *customViewController;

Swift

var customViewController: UIViewController? { get }

-init

Undocumented

Objective-C

- (instancetype)init NS_UNAVAILABLE;

+disabledConfiguration

Use this configuration if you wish to manage a lock screen yourself. This may be useful if the automatic presentation feature of SDLLockScreenManager is failing for some reason.

Objective-C

+ (nonnull instancetype)disabledConfiguration;

Swift

class func disabled() -> Self

Return Value

The configuration

+enabledConfiguration

Use this configuration for the basic default lock screen. A custom app icon will not be used.

Objective-C

+ (nonnull instancetype)enabledConfiguration;

Swift

class func enabled() -> Self

Return Value

The configuration

+enabledConfigurationWithAppIcon:backgroundColor:

Use this configuration to provide a custom lock screen icon and a custom background color, or nil if you wish to use the default background color. This will use the default lock screen layout.

Objective-C

+ (nonnull instancetype)
    enabledConfigurationWithAppIcon:(nonnull UIImage *)lockScreenAppIcon
                    backgroundColor:
                        (nullable UIColor *)lockScreenBackgroundColor;

Swift

class func enabledConfiguration(withAppIcon lockScreenAppIcon: UIImage, backgroundColor lockScreenBackgroundColor: UIColor?) -> Self

Parameters

lockScreenAppIcon

The app icon to be shown on the lock screen

lockScreenBackgroundColor

The color of the lock screen background

Return Value

The configuration

+enabledConfigurationWithViewController:

Use this configuration if you wish to provide your own view controller for the lock screen. This view controller’s presentation and dismissal will still be managed by the lock screen manager. Note that you may subclass SDLLockScreenViewController and pass it here to continue to have the vehicle icon set to your view controller by the manager.

Objective-C

+ (nonnull instancetype)enabledConfigurationWithViewController:
    (nonnull UIViewController *)viewController;

Swift

class func enabledConfiguration(with viewController: UIViewController) -> Self

Parameters

viewController

The view controller to be managed

Return Value

The configuration

View on GitHub.com
Previous Section Next Section