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

SDLAlert Class Reference

Section Contents

Overview

Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.

  • The displayed portion of the SDLAlert, if any, will persist until the specified timeout has elapsed, or the SDLAlert is preempted
  • An SDLAlert will preempt (abort) any SmartDeviceLink Operation that is in-progress, except an already-in-progress SDLAlert
  • An SDLAlert cannot be preempted by any SmartDeviceLink Operation
  • An SDLAlert can be preempted by a user action (button push)
  • An SDLAlert will fail if it is issued while another SDLAlert is in progress
  • Although each Alert parameter is optional, in fact each SDLAlert request must supply at least one of the following parameters:
    • alertText1
    • alertText2
    • alertText3
    • ttsChunks

HMILevel needs to be FULL or LIMITED.
If the app has been granted function group Notification the SDLHMILevel can also be BACKGROUND

@since SDL 1.0

-initWithAlertText1:alertText2:duration:

Undocumented

Objective-C

- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 duration:(UInt16)duration;

Swift

init(alertText1: String?, alertText2: String?, duration: UInt16)

-initWithAlertText1:alertText2:alertText3:

Undocumented

Objective-C

- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3;

Swift

init(alertText1: String?, alertText2: String?, alertText3: String?)

-initWithAlertText1:alertText2:alertText3:duration:

Undocumented

Objective-C

- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration;

Swift

init(alertText1: String?, alertText2: String?, alertText3: String?, duration: UInt16)

-initWithAlertText1:alertText2:alertText3:duration:softButtons:

Undocumented

Objective-C

- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;

Swift

init(alertText1: String?, alertText2: String?, alertText3: String?, duration: UInt16, softButtons: [SDLSoftButton]?)

-initWithTTS:playTone:

Undocumented

Objective-C

- (instancetype)initWithTTS:(nullable NSString *)ttsText playTone:(BOOL)playTone;

Swift

init(tts ttsText: String?, playTone: Bool)

-initWithTTS:alertText1:alertText2:playTone:duration:

Undocumented

Objective-C

- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 playTone:(BOOL)playTone duration:(UInt16)duration;

Swift

init(tts ttsText: String?, alertText1: String?, alertText2: String?, playTone: Bool, duration: UInt16)

-initWithTTS:alertText1:alertText2:alertText3:playTone:duration:

Undocumented

Objective-C

- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration;

Swift

init(tts ttsText: String?, alertText1: String?, alertText2: String?, alertText3: String?, playTone: Bool, duration: UInt16)

-initWithTTSChunks:playTone:

Undocumented

Objective-C

- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone;

Swift

init(ttsChunks: [SDLTTSChunk]?, playTone: Bool)

-initWithTTSChunks:alertText1:alertText2:alertText3:playTone:softButtons:

Undocumented

Objective-C

- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;

Swift

init(ttsChunks: [SDLTTSChunk]?, alertText1: String?, alertText2: String?, alertText3: String?, playTone: Bool, softButtons: [SDLSoftButton]?)

-initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:

Undocumented

Objective-C

- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;

Swift

init(ttsChunks: [SDLTTSChunk]?, alertText1: String?, alertText2: String?, alertText3: String?, playTone: Bool, duration: UInt16, softButtons: [SDLSoftButton]?)

alertText1

The String to be displayed in the first field of the display during the Alert

@discussion Length is limited to what is indicated in SDLRegisterAppInterface response

If omitted, top display line will be cleared

Text is always centered

Optional, Max length 500 chars

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSString *alertText1;

Swift

var alertText1: String? { get set }

alertText2

The String to be displayed in the second field of the display during the Alert

@discussion Only permitted if HMI supports a second display line

Length is limited to what is indicated in SDLRegisterAppInterface response

If omitted, second display line will be cleared

Text is always centered

Optional, Max length 500 chars

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSString *alertText2;

Swift

var alertText2: String? { get set }

alertText3

the String to be displayed in the third field of the display during the Alert @discussion Only permitted if HMI supports a third display line

Length is limited to what is indicated in SDLRegisterAppInterface response

If omitted, third display line will be cleared

Text is always centered

Optional, Max length 500 chars

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSString *alertText3;

Swift

var alertText3: String? { get set }

ttsChunks

An array which, taken together, specify what is to be spoken to the user

Optional, Array of SDLTTSChunk, Array length 1 - 100

See

SDLTTSChunk

Objective-C

@property (readwrite, strong, nonatomic, nullable)
    NSArray<SDLTTSChunk *> *ttsChunks;

Swift

var ttsChunks: [SDLTTSChunk]? { get set }

duration

The duration of the displayed portion of the alert, in milliseconds.

@discussion After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began.

Typical timeouts are 3 - 5 seconds

If omitted, the timeout is set to 5 seconds

Optional, Integer, 3000 - 10000

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSNumber<SDLInt> *duration;

Swift

var duration: (NSNumber & SDLInt)? { get set }

playTone

Whether the alert tone should be played before the TTS (if any) is spoken.

@discussion If ommitted, no tone is played

Optional, Boolean

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSNumber<SDLBool> *playTone;

Swift

var playTone: (NSNumber & SDLBool)? { get set }

progressIndicator

If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.

Optional, Boolean

@since SmartDeviceLink 2.0

Objective-C

@property (readwrite, strong, nonatomic, nullable)
    NSNumber<SDLBool> *progressIndicator;

Swift

var progressIndicator: (NSNumber & SDLBool)? { get set }

softButtons

App defined SoftButtons.

@discussion If omitted on supported displays, the displayed alert shall not have any SoftButtons

Optional, Array of SDLSoftButton, Array size 0 - 4

See

SDLSoftButton

Objective-C

@property (readwrite, strong, nonatomic, nullable)
    NSArray<SDLSoftButton *> *softButtons;

Swift

var softButtons: [SDLSoftButton]? { get set }
View on GitHub.com
Previous Section Next Section