js-miniapp-sdk

Globals / ChatServiceProvider

Interface: ChatServiceProvider

Hierarchy

Index

Methods

Methods

sendMessageToContact

sendMessageToContact(message: MessageToContact): Promise<string | undefined>

Defined in js-miniapp-sdk/src/modules/chat-service.ts:13

Opens a contact chooser which allows the user to choose a single contact, and then sends the message to the chosen contact.

Parameters:

Name Type Description
message MessageToContact The message to send to contact.

Returns: Promise<string | undefined>

Promise resolves with the Unique ID which was sent the message. Can also resolve with empty (undefined) response in the case that the message was not sent to a contact, such as if the user cancelled sending the message. Promise rejects in the case that there was an error.