在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pubnub/javascript开源软件地址:https://github.com/pubnub/javascript开源编程语言:JavaScript 94.5%开源软件介绍:PubNub JavaScript SDK (V4)This is the official PubNub JavaScript SDK repository. PubNub takes care of the infrastructure and APIs needed for the realtime communication layer of your application. Work on your app's logic and let PubNub handle sending and receiving data across the world in less than 100ms. Get keysYou will need the publish and subscribe keys to authenticate your app. Get your keys from the Admin Portal. Configure PubNub
pubnub = new PubNub({
publishKey : "myPublishKey",
subscribeKey : "mySubscribeKey",
uuid: "myUniqueUUID"
}) Add event listenerspubnub.addListener({
message: function (m) {
// handle messages
},
presence: function (p) {
// handle presence
},
signal: function (s) {
// handle signals
},
objects: (objectEvent) => {
// handle objects
},
messageAction: function (ma) {
// handle message actions
},
file: function (event) {
// handle files
},
status: function (s) {
// handle status
},
}); Publish/subscribevar publishPayload = {
channel : "hello_world",
message: {
title: "greeting",
description: "This is my first message!"
}
}
pubnub.publish(publishPayload, function(status, response) {
console.log(status, response);
})
pubnub.subscribe({
channels: ["hello_world"]
}); Documentation
SupportIf you need help or have a general question, contact [email protected]. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论