Shows an alert which typically consists of text-to-speech message and text on the display. Either alertText1
, alertText2
or TTSChunks
needs to be set or the request will be rejected.
If connecting to SDL Core v.6.0+, the alert can be canceled programmatically using the cancelID
. Canceling will not dismiss the alert’s speech - only the modal view will be dismissed. On older versions of SDL Core, the alert will persist until the user has interacted with the alert or the specified timeout has elapsed.
@since SDL 1.0
Convenience init for creating a modal view with text, buttons, and optional sound cues.
- (nonnull instancetype)
initWithAlertText:(nullable NSString *)alertText
softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons
playTone:(BOOL)playTone
ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks
alertIcon:(nullable SDLImage *)icon
cancelID:(UInt32)cancelID;
init(alertText: String?, softButtons: [SDLSoftButton]?, playTone: Bool, ttsChunks: [SDLTTSChunk]?, alertIcon icon: SDLImage?, cancelID: UInt32)
The string to be displayed in the first field of the display
Soft buttons to be displayed
Whether the alert tone should be played before the TTS (if any) is spoken
Speech or a sound file to be played when the alert shows
An ID for this specific alert to allow cancellation through the CancelInteraction
RPC
Image to be displayed in the alert
An SDLAlert object
Convenience init for creating a sound-only alert.
- (nonnull instancetype)initWithTTSChunks:
(nullable NSArray<SDLTTSChunk *> *)ttsChunks
playTone:(BOOL)playTone;
init(ttsChunks: [SDLTTSChunk]?, playTone: Bool)
Speech or a sound file to be played when the alert shows
Whether the alert tone should be played before the TTS is spoken
An SDLAlert object
Convenience init for setting all alert parameters.
- (nonnull instancetype)
initWithAlertText1:(nullable NSString *)alertText1
alertText2:(nullable NSString *)alertText2
alertText3:(nullable NSString *)alertText3
softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons
playTone:(BOOL)playTone
ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks
duration:(UInt16)duration
progressIndicator:(BOOL)progressIndicator
alertIcon:(nullable SDLImage *)icon
cancelID:(UInt32)cancelID;
init(alertText1: String?, alertText2: String?, alertText3: String?, softButtons: [SDLSoftButton]?, playTone: Bool, ttsChunks: [SDLTTSChunk]?, duration: UInt16, progressIndicator: Bool, alertIcon icon: SDLImage?, cancelID: UInt32)
The first line of the alert
The second line of the alert
The third line of the alert
Buttons for the alert
Whether the alert tone should be played before the TTS (if any) is spoken
An array of text chunks to be spoken or a prerecorded sound file
The duration of the displayed portion of the alert, in milliseconds
Whether an animation indicating that loading of a feature is progressing should be shown
An ID for this specific alert to allow cancellation through the CancelInteraction
RPC
Image to be displayed in the alert
An SDLAlert object
The first line of the alert text field.
@discussion At least either alertText1
, alertText2
or ttsChunks
need to be provided.
@discussion If supported, the displayCapabilities
will have a TextField
with a name
of alertText1
.
String, Optional, Max length 500 chars @since SDL 1.0
@property (nonatomic, strong, nullable) NSString *alertText1;
var alertText1: String? { get set }
The second line of the alert text field.
@discussion At least either alertText1
, alertText2
or ttsChunks
need to be provided.
@discussion If supported, the displayCapabilities
will have a TextField
with a name
of alertText2
String, Optional, Max length 500 chars @since SDL 1.0
@property (nonatomic, strong, nullable) NSString *alertText2;
var alertText2: String? { get set }
The optional third line of the alert text field.
@discussion If supported, the displayCapabilities
will have a TextField
with a name
of alertText3
String, Optional, Max length 500 chars @since SDL 2.0
@property (nonatomic, strong, nullable) NSString *alertText3;
var alertText3: String? { get set }
An array of text chunks to be spoken or a prerecorded sound file.
@discussion At least either alertText1
, alertText2
or ttsChunks
need to be provided.
Array of SDLTTSChunk, Optional, Array length 1 - 100
@since SDL 1.0
@property (nonatomic, strong, nullable) NSArray<SDLTTSChunk *> *ttsChunks;
var ttsChunks: [SDLTTSChunk]? { get set }
The duration of the displayed portion of the alert, in milliseconds. Typical timeouts are 3 - 5 seconds. If omitted, the timeout is set to a default of 5 seconds.
Integer, Optional, Min value: 3000, Max value: 10000
@since SDL 1.0
@property (nonatomic, strong, nullable) NSNumber<SDLInt> *duration;
var duration: (NSNumber & SDLInt)? { get set }
Whether the alert tone should be played before the TTS (if any) is spoken. If omitted or set to false, no tone is played.
Boolean, Optional
@since SDL 1.0
@property (nonatomic, strong, nullable) NSNumber<SDLBool> *playTone;
var playTone: (NSNumber & SDLBool)? { get set }
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.).
Boolean, Optional
@since SDL 2.0
@property (nonatomic, strong, nullable) NSNumber<SDLBool> *progressIndicator;
var progressIndicator: (NSNumber & SDLBool)? { get set }
Buttons for the displayed alert. If omitted on supported displays, the displayed alert shall not have any buttons.
Array of SDLSoftButton, Optional, Array size 0 - 4
@since SDL 2.0
@property (nonatomic, strong, nullable) NSArray<SDLSoftButton *> *softButtons;
var softButtons: [SDLSoftButton]? { get set }
An ID for this specific alert to allow cancellation through the CancelInteraction
RPC.
Integer, Optional
See
SDLCancelInteraction @since SDL 6.0@property (nonatomic, strong, nullable) NSNumber<SDLInt> *cancelID;
var cancelID: (NSNumber & SDLInt)? { get set }
Image to be displayed in the alert. If omitted on supported displays, no (or the default if applicable) icon should be displayed.
SDLImage, Optional @since SDL 6.0
@property (nonatomic, strong, nullable) SDLImage *alertIcon;
var alertIcon: SDLImage? { get set }