Options
All
  • Public
  • Public/Protected
  • All
Menu

Main class. Contains all others methods and websocket subscription

Hierarchy

  • Notification

Index

Constructors

constructor

Methods

isSubscribed

  • isSubscribed(): boolean
  • Checks if user is subscribed

    method

    isSubscribed

    example
       InPlayer.isSubscribed()
    

    Returns boolean

setConfig

  • setConfig(env: Env): void
  • Overrides the default configs

    method

    setConfig

    example
    InPlayer.setConfig('development');
    

    Parameters

    Returns void

subscribe

  • subscribe(accountUuid: string, callbackParams: Record<string, (...params: any) => void>): void
  • Subscribes to websocket events

    method

    subscribe

    example
    InPlayer.subscribe(
    'adsasd-d1-cjc1c-1ajaveo',
    {
    onMessage: (message) =>
    {
    let body = JSON.parse(message.body); console.log(body, 'message')
    },
    onOpen: (e) => console.log('open'),
    onClose: (e) => console.log('close', e)
    }

    )

    Parameters

    • accountUuid: string

      The users account UUID

    • callbackParams: Record<string, (...params: any) => void>

      Methods regarding websocket { onMessage: function, onOpen: function, onClose: function }

    Returns void

unsubscribe

  • unsubscribe(): void
  • Unsubscribes from the websocket and event listeners

    method

    unsubscribe

    example
    InPlayer.unsubscribe()
    

    Returns void

Generated using TypeDoc