PubNub Angularjs,通道组中出错

时间:2016-05-04 14:42:26

标签: angularjs pubnub

我已经跟随此DOCUMENT与渠道组PubNub Angularjs合作。但我得到了这个错误:

enter image description here

这是我的代码:

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
});

有人请帮助我!

1 个答案:

答案 0 :(得分:2)

我发现它,channel_group应该是字符串而不是数字:



channel_group: "" + $scope.user.IncubatorContactId + ""