One Logo Pool Ball
Messages · IOS API REFERENCE

MSCriticalSMSMessenger

class · iOS 18.2+ · SDK 27.1

@objc class MSCriticalSMSMessenger

MSCriticalMessenger This class is the interface for all messaging APIs.

Members (5)

init · iOS 18.2+

init

TypeScript
static init(): MSCriticalSMSMessenger
Swift declaration
override dynamic init()
method · iOS 18.2+

requestAuthorization

TypeScript
requestAuthorization(recipients: Array<MSRecipient>): Promise<NativeMap<MSRecipient, MSCriticalMessagingAuthorizationStatus>>
Swift declaration
func requestAuthorization(for recipients: [MSRecipient]) async throws -> [MSRecipient : MSCriticalMessagingAuthorizationStatus]

Request user authorization to be able to send critical messages from this app. The user will be shown an authorization alert for each recipient one at a time. This method can be called multiple times with the same or different recipients, and the permission alert will always be displayed with the latest block of recipients. When this method is called subsequent times, all previous recipients are automatically moved to an unauthorized status. - Parameters: - recipients: The full set of recipients that the app wants to request access for. A non-conforming array (such as specifying more recipients than maxCriticalMessagingRecipients) will throw MSCriticalMessagingErrorInvalidAuthRequest. - Returns: A dictionary map of recipients to their corresponding authorization status - Throws: An error of MSCriticalMessagingErrorDomain.

method · iOS 18.2+

checkAuthorizationStatus

TypeScript
checkAuthorizationStatus(recipients: Array<MSRecipient>): Promise<NativeMap<MSRecipient, MSCriticalMessagingAuthorizationStatus>>
Swift declaration
func checkAuthorizationStatus(for recipients: [MSRecipient]) async throws -> [MSRecipient : MSCriticalMessagingAuthorizationStatus]

Check the current use authorization for sending critical messages from this app. This can be called multiple times to check the authorization status for multiple recipients piecemeal. - Parameters: - recipients: The recipients to check the authorization status for. - Returns: A dictionary map of recipients to their corresponding authorization status - Throws: An error of MSCriticalMessagingErrorDomain.

get · iOS 18.2+

maximumCriticalMessagingRecipients

TypeScript
get maximumCriticalMessagingRecipients(): number
Swift declaration
var maximumCriticalMessagingRecipients: Int { get }

The maximum number of recipients that can be passed into requestAuthorizationForCriticalMessaging(recipients) at once.

method · iOS 18.2+

send

TypeScript
send(message: MSCriticalMessage, recipient: MSRecipient): Promise<boolean>
Swift declaration
func send(_ message: MSCriticalMessage, to recipient: MSRecipient) async throws -> Bool

Send a critical message to the specific recipient. There is no user interaction needed for this message to be sent. If the message sends successfully, the user will be shown a notification indicating a message was sent. - Parameters: - message: The message to send - recipient: The recipient to send the message to - Returns: True if the message successfully sends - Throws: An error of MSCriticalMessagingErrorDomain.

Skipped declarations

No declarations were skipped in this snapshot.

All Messages types →