1.2.2 • Published 6 years ago

aoc-signal v1.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Javascript signal sdk for AOC, this library is based on js-realtime-sdk.

Dependencies

Installation

npm install --save aoc-signal

Usage

var signalService = new SignalService({
    appId: 'xxxxxx',
    appKey: 'xxxxxx'
});

const callbacks = {
    onDisconnect: () => {
        console.log('[disconnect] 服务器连接已断开');
    },
    onReconnect: () => {
        console.log('[reconnect] 重连成功');
    },
    onReconnecterror: () => {
        console.log('[reconnecterror] 重连失败');
    }
};

const testRoom = {
    name: 'testroom',
    members: ['Tom', 'Jerry']
};

const roomCallbacks = {
    onSignal: (signal) => {

    }
};
signalService.login('Tom', callbacks)
  .then(servie => {
      return service.joinRoom(testRoom, roomCallbacks);
  })    
  .then(room => {
      return room.broadcastMsg('hello');
  })
  .then(signal => {
      console.log(`send message success`);
  })

Documentation

This project use typedoc to auto generate API document.

visit API document

1.2.2

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago