0.8.2 • Published 7 years ago

socket.io-push-client v0.8.2

Weekly downloads
40
License
-
Repository
github
Last release
7 years ago

node 依赖

npm install socket.io-push-client --save

js sdk

source

minified

初始化

var pushClient = PushClient('https://spush.yy.com', {
            transports: ['websocket'], //使用的tranport, proxy如果是多进程模式, 不支持polling
            useNotification: true //是否接收notification
        });

获取pushId

var pushId = pushClient.pushId

subscribe topic

var topic = 'topic';
pushClient.subscribeTopic(topic);
pushClient.unsubscribeTopic(topic);

push callback

pushClient.on('push',function(data){

});

notification callback

pushClient.on('notification',function(notification){
  console.log('',notification.title,notification.message,notification.payload);
});

connect callback

pushClient.on('connect',function(data){
  console.log('',data.uid);
});

pushClient.on('disconnect',function(){

});
0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.0.198

7 years ago

0.0.197

7 years ago

0.0.196

7 years ago

0.0.195

7 years ago

0.0.194

8 years ago

0.0.193

8 years ago