js-miniapp-sdk

Globals / ChatServiceProvider

Interface: ChatServiceProvider

Hierarchy

Index

Methods

Methods

sendMessageToContact

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

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 | null>

Promise resolves with the contact id received a message. Can also resolve with null 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.


sendMessageToContactId

sendMessageToContactId(id: string, message: MessageToContact): Promise<string | null>

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

Send a message to the specific contact.

see {sendMessageToContact}

Parameters:

Name Type Description
id string The id of the contact receiving a message.
message MessageToContact The message to send to contact.

Returns: Promise<string | null>

Promise resolves with the contact id received a message.


sendMessageToMultipleContacts

sendMessageToMultipleContacts(message: MessageToContact): Promise<string[] | null>

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

Opens a contact chooser which allows the user to choose a multiple contacts and then sends the message to the all chosen contacts.

Parameters:

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

Returns: Promise<string[] | null>

Promise resolves with an array of contact id which were sent the message. Can also resolve with null array in the case that the message was not sent to any contacts, such as if the user cancelled sending the message. Promise rejects in the case that there was an error.