Invitations

interface Invitations

This module provides methods for managing invitations within the Rainbow network.

The Invitations interface offers functionality to interact with invitations sent or received by the user. It enables users to track, refresh, and manage invitations in various states, such as pending, accepted, or declined.

This interface can be used to:

  • Retrieve sent invitations: Access a list of invitations sent by the user to other contacts.

  • Retrieve received invitations: Access a list of invitations received by the user from other contacts.

  • Send new invitations: Invite other users to join the user's network.

  • Accept or decline invitations: Respond to received invitations based on the user's preference.

  • Cancel sent invitations: Withdraw invitations that are no longer needed or relevant.

  • Search for invitations: Look up a specific invitation by its unique identifier.

The state of each invitation can be tracked, including whether it is pending, accepted, or declined etc.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val receivedInvitations: StateFlow<List<Invitation>>

A reactive hot flow of invitations received by the user.

Link copied to clipboard
abstract val sentInvitations: StateFlow<List<Invitation>>

A reactive hot flow of invitations sent by the user.

Functions

Link copied to clipboard
abstract suspend fun acceptInvitation(invitationId: String): RainbowResult<Unit>

Accepts an invitation to join the user's network.

Link copied to clipboard
abstract suspend fun addContactToNetwork(contact: IRainbowContact): RainbowResult<Invitation>

Invites a contact to join the user's network.

Link copied to clipboard
abstract suspend fun cancelSentInvitation(invitationId: String): RainbowResult<Unit>

Cancels an invitation that has been sent by the user.

Link copied to clipboard
abstract suspend fun declineInvitation(invitationId: String): RainbowResult<Unit>

Declines an invitation to join the user's network.

Link copied to clipboard
abstract suspend fun declineOrCancelInvitation(invitationId: String): RainbowResult<Unit>

Declines or cancels an invitation based on its type.

Link copied to clipboard
abstract fun getInvitationById(invitationId: String): Invitation?

Retrieves an invitation by its unique identifier.

Link copied to clipboard
abstract suspend fun inviteUser(inviteUser: InviteUser): RainbowResult<Invitation>

Sends an invitation using the InviteUser.Builder.

Link copied to clipboard
abstract suspend fun inviteUserByEmail(email: String): RainbowResult<Invitation>

Sends an email invitation or a visibility request to register or connect on Rainbow.

Link copied to clipboard
abstract suspend fun inviteUserBySms(phoneNumber: String): RainbowResult<Invitation>

Creates an SMS invitation to register an account on Rainbow.

Link copied to clipboard
abstract fun isContactInvited(contact: IRainbowContact): Boolean

Checks if a contact has been invited by the user.

Link copied to clipboard
abstract suspend fun refreshReceivedInvitations(): RainbowResult<List<Invitation>>

Refreshes the list of received invitations.

Link copied to clipboard
abstract suspend fun refreshSentInvitations(): RainbowResult<List<Invitation>>

Refreshes the list of sent invitations.

Link copied to clipboard
abstract suspend fun removeContactFromNetwork(contact: IRainbowContact): RainbowResult<Unit>

Removes a contact from the user's network.