SDLSubtleAlert 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.

@since SDL 7.0.0

-initWithAlertText1:alertText2:alertIcon:ttsChunks:duration:softButtons:cancelID:

Objective-C

- (nonnull instancetype)
    initWithAlertText1:(nullable NSString *)alertText1
            alertText2:(nullable NSString *)alertText2
             alertIcon:(nullable SDLImage *)alertIcon
             ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks
              duration:(nullable NSNumber<SDLUInt> *)duration
           softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons
              cancelID:(nullable NSNumber<SDLInt> *)cancelID;

Swift

init(alertText1: String?, alertText2: String?, alertIcon: SDLImage?, ttsChunks: [SDLTTSChunk]?, duration: (NSNumber & SDLUInt)?, softButtons: [SDLSoftButton]?, cancelID: (NSNumber & SDLInt)?)

Parameters

alertText1

- alertText1

alertText2

- alertText2

alertIcon

- alertIcon

ttsChunks

- ttsChunks

duration

- duration

softButtons

- softButtons

cancelID

- cancelID

Return Value

A SDLSubtleAlert object

alertText1

The first line of the alert text field {“default_value”: null, “max_length”: 500, “min_length”: 1}

Objective-C

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

Swift

var alertText1: String? { get set }

alertText2

The second line of the alert text field {“default_value”: null, “max_length”: 500, “min_length”: 1}

Objective-C

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

Swift

var alertText2: String? { get set }

alertIcon

Image to be displayed for the corresponding alert. See Image. If omitted on supported displays, no (or the default if applicable) icon should be displayed.

Objective-C

@property (nonatomic, strong, nullable) SDLImage *alertIcon;

Swift

var alertIcon: SDLImage? { get set }

ttsChunks

An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item. {“default_value”: null, “max_size”: 100, “min_size”: 1}

Objective-C

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

Swift

var ttsChunks: [SDLTTSChunk]? { get set }

duration

Timeout in milliseconds. Typical timeouts are 3-5 seconds. If omitted, timeout is set to 5s. {“default_value”: 5000, “max_value”: 10000, “min_value”: 3000}

Objective-C

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

Swift

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

softButtons

App defined SoftButtons. If omitted on supported displays, the displayed alert shall not have any SoftButtons. {“default_value”: null, “max_size”: 2, “min_size”: 0}

Objective-C

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

Swift

var softButtons: [SDLSoftButton]? { get set }

cancelID

An ID for this specific alert to allow cancellation through the CancelInteraction RPC. {“default_value”: null, “max_value”: null, “min_value”: null}

Objective-C

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

Swift

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