init
TypeScriptstatic init(): MSCriticalSMSMessengerSwift declarationoverride dynamic init()class · iOS 18.2+ · SDK 27.1
@objc class MSCriticalSMSMessengerMSCriticalMessenger This class is the interface for all messaging APIs.
static init(): MSCriticalSMSMessengerSwift declarationoverride dynamic init()requestAuthorization(recipients: Array<MSRecipient>): Promise<NativeMap<MSRecipient, MSCriticalMessagingAuthorizationStatus>>Swift declarationfunc 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.
checkAuthorizationStatus(recipients: Array<MSRecipient>): Promise<NativeMap<MSRecipient, MSCriticalMessagingAuthorizationStatus>>Swift declarationfunc 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 maximumCriticalMessagingRecipients(): numberSwift declarationvar maximumCriticalMessagingRecipients: Int { get }The maximum number of recipients that can be passed into requestAuthorizationForCriticalMessaging(recipients) at once.
send(message: MSCriticalMessage, recipient: MSRecipient): Promise<boolean>Swift declarationfunc send(_ message: MSCriticalMessage, to recipient: MSRecipient) async throws -> BoolSend 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.
No declarations were skipped in this snapshot.