我已经跟随此DOCUMENT与渠道组PubNub Angularjs合作。但我得到了这个错误:
这是我的代码:
Pubnub.init({
publish_key: constants.PUBNUB_PUBLISH_KEY,
subscribe_key: constants.PUBNUB_SUBSCRIBE_KEY,
uuid: $scope.user.IncubatorContactId + "_Layout",
error: function(error) {
console.log('Pubnub.init() Error:', error);
}
});
Pubnub.channel_group_add_channel({
callback: function(m) {
console.log('channel_group_add_channel', 'success', m);
},
channel: channels[0],
channel_group: $scope.user.IncubatorContactId
});
有人请帮助我!
答案 0 :(得分:2)
我发现它,channel_group应该是字符串而不是数字:
channel_group: "" + $scope.user.IncubatorContactId + ""