获取在线用户PubNub始终无目标C的列表



我的问题在pubnub-chat目标c的用户列表中相同,但似乎没有有用的答案。

  1. 我将客户与Pub&带有存在的子键=是
  2. 我已供应"我的频道",并可以将味精发送到
  3. 我在PubNub管理员中使用了调试控制台创建2个其他客户端,我可以一起发送MSG
  4. i在管理员(http://prntscr.com/iyv7b1(
  5. 我获得了列表用户,可以通过函数订阅"我的频道":
[client hereNowForChannel:@"My channel" withVerbosity:PNHereNowState completion:^(PNPresenceChannelHereNowResult *result, PNErrorStatus *status)
 {
     if (!status) {
     }
     else {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Couldn't get list of user." delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];
         [alert show];
     }
 }];

我试图更改

PNHereNowState -> PNHereNowUUID -> PNHereNowOccupancy

,但我的结果始终是零。

AnyBode帮助我,请

我找到了我的问题的答案,希望它能帮助谁需要

[client hereNowForChannel:client.globalChannel withCompletion:^(PNPresenceChannelHereNowResult *result, PNErrorStatus *status)
 {
     if (!status) {
         PNPresenceChannelHereNowData *data = result.data;
         if (data) {
             NSArray *list = [data uuids];
         }
     }
     else {
     }
 }];

属性 data ,如果尚未访问它,它将不会设置值有数据。

最新更新