Zello SDK. This class is a singleton, and can be accessed via Zello.getInstance.

Hierarchy

  • default
    • Zello

Properties

accountStatus: undefined | ZelloAccountStatus

The current account status. undefined when state is not ZelloConnectionState.Connected.

channels: ZelloChannel[] = []

The list of ZelloChannel in the contact list. Sorted by name, ascending.

consoleSettings: undefined | ZelloConsoleSettings

The console settings for the network. This is only expected to be valid when state is ZelloConnectionState.Connected.

emergencyChannel: undefined | ZelloChannel

The configured emergency channel.

groupConversations: ZelloGroupConversation[] = []

The list of ZelloGroupConversation in the contact list. Sorted by name, ascending.

historyVoiceMessage: undefined | ZelloHistoryVoiceMessage

The currently playing history voice message.

incomingEmergencies: ZelloIncomingEmergency[] = []

The list of incoming emergencies. There can be multiple emergencies on the emergency channel at once. Sorted by start timestamp, ascending.

incomingVoiceMessage: undefined | ZelloIncomingVoiceMessage

The current incoming voice message.

outgoingEmergency: undefined | ZelloOutgoingEmergency

The current outgoing emergency.

outgoingVoiceMessage: undefined | ZelloOutgoingVoiceMessage

The current outgoing voice message.

recents: ZelloRecentEntry[] = []

The list of recent entries. Sorted by timestamp, descending.

selectedContact: undefined | ZelloContact

The currently selected contact.

state: ZelloConnectionState = ZelloConnectionState.Disconnected

The current connection state of the SDK.

users: ZelloUser[] = []

The list of ZelloUser in the contact list. Sorted by name, ascending.

Methods

  • Adds a listener to be invoked when events of the specified type are emitted. An optional calling context may be provided. The data arguments emitted will be passed to the listener function.

    Parameters

    • eventType: string

      Name of the event to listen to

    • listener: ((...args: any[]) => any)

      Function to invoke when the specified event is emitted

        • (...args): any
        • Parameters

          • Rest...args: any[]

          Returns any

    • Optionalcontext: any

      Optional context object to use when invoking the listener

    Returns EmitterSubscription

  • Sets configuration variables for the SDK.

    Parameters

    Returns void

  • Destroys the SDK instance and cleans up resources. Call this when you are done using the SDK instance for good (application quit).

    Returns void

  • Disconnects from the given channel. Once disconnected, the user will no longer be able to send or receive messages from the channel. This will trigger the ZelloEvent.CONTACT_LIST_UPDATED event.

    Parameters

    Returns void

  • Emits an event of the given type with the given data. All handlers of that particular type will be notified.

    Parameters

    • eventType: string

      Name of the event to emit

    • Rest...params: any[]

    Returns void

    emitter.addListener('someEvent', function(message) {
    console.log(message);
    });

    emitter.emit('someEvent', 'abc'); // logs 'abc'
  • Returns the channel with the given name. Case-insensitive.

    Parameters

    • name: string

      The name of the channel to search for.

    Returns undefined | ZelloChannel

    The channel with the given name, or null if no channel with that name exists.

  • Returns the group conversation with the given name. Case-insensitive.

    Parameters

    • name: string

      The name of the group conversation to search for.

    Returns undefined | ZelloGroupConversation

    The group conversation with the given name, or null if no group conversation with that name exists.

  • Returns the history messages for the given contact.

    Parameters

    • contact: ZelloContact

      The contact to get the history for.

    • Optionalsize: number

      Optional; The number of history items to retrieve. Defaults to 50.

    Returns Promise<ZelloHistoryMessage[]>

    The history items for the given contact.

  • Returns the image data for the given history image message.

    Parameters

    Returns Promise<undefined | string>

    The image data for the given history image message.

  • Returns the user with the given name. Case-insensitive.

    Parameters

    • name: string

      The name of the user to search for.

    Returns undefined | ZelloUser

    The user with the given name, or null if no user with that name exists.

  • Returns the number of listeners that are currently registered for the given event.

    Parameters

    • eventType: string

      Name of the event to query

    Returns number

  • Removes all of the registered listeners, including those registered as listener maps.

    Parameters

    • OptionaleventType: string

      Optional name of the event whose registered listeners to remove

    Returns void

  • Sets the selected contact. While optional, this is typically used for tracking the contact that the user is currently interacting with. This will trigger the ZelloEvent.SELECTED_CONTACT_CHANGED event.

    Parameters

    Returns void

  • Starts an outgoing emergency to the emergency channel. Upon starting, the user's location will be sent, an alert message will be sent, and a 10-second-long voice message will start recording. This will trigger the ZelloEvent.OUTGOING_EMERGENCY_STARTED event.

    Returns void

  • Submits a problem report to Zello. Additionally, please contact us to provide more information on what happened.

    Returns void