var PubNub = require("pubnub");
var pubnub = new PubNub({
channel: 'Channel-xxxxxxxx',
publishKey : "pub-c-b91315c1-e6a1-xxxx-xxxx-xxxxxxxxxxxx",
subscribeKey : "sub-c-b4735f6a-b6f6-xxxx-xxxx-xxxxxxxxxxxx" });
pubnub.subscribe({
channel: 'Channel-xxxxxxxx',
callback: function(message) {
console.log("Message received: ", message);
},
error: function (err) {
console.log(err);
} });
,不知道我要去的地方錯了回調不工作在訂閱時使用pubnub上pubnub文件建立仍然無法使其工作給定的樣本代碼的NodeJS
很好,我的代碼有問題。我認爲在pubnub的新版本中,他們已將「頻道」關鍵字更改爲「頻道」,因爲它解決了我面臨的問題 – sheelpriy