Contents

send(_:completionHandler:)

Sends a sticker.

Declaration

func send(_ sticker: MSSticker, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
func send(_ sticker: MSSticker) async throws

Parameters

  • sticker:

    The sticker to send.

  • completionHandler:

    A block that’s called as soon as the message starts sending. This block is passed the following parameter:

    error

    An error object. If an error occurred, this object contains information about the error; otherwise, it’s set to nil. An error occurs if the user hasn’t recently interacted with your app.

Mentioned in

Discussion

This method starts sending the sticker automatically, without any additional user interactions. You can call this method only in response to a user action while in the MSMessagesAppPresentationContext.messages context.

When calling this method, the following rules apply:

This method operates asynchronously. Although the method returns immediately, the actual work is deferred and performed in the background. As soon as the message starts to send, the system calls the completion block on a background queue.

See Also

Directly Sending a Message