分组推送失败,cannot find user by this audience

jpush
标签: #<Tag:0x00007fb83f554250>

(Zouyuanfeng) #1

之前用的是单推的,只是把JPushClient#sendPush改成了GroupPushClient#sendGroupPush,key改成了对应的groupKey,其他没有变化,是还需要改什么吗

{
  "935055881cb3afce340d193f": {
    "msg_id": 29273399735913172,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  },
  "c9b2ea7ad4307bf8e61d2ccb": {
    "msg_id": 29273399735913172,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  },
  "42207462fd7e14922f8de07b": {
    "msg_id": 489109776,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  }
}

#2

你的意思是你单独对其中一个 AppKey 做推送,条件一样,不会报错 1011 吗?
请将你单独推送不会报错的AppKey和msgid提供一下。


(Zouyuanfeng) #3

935055881cb3afce340d193f
27021598120679543


#4

你是不是没有改分组推送的域名?

你分组推送的搜索不到推送记录,看一下域名:


(Zouyuanfeng) #5

还需要改域名吗?用的默认的


#6

你的应用都在北京机房,改一下域名


(Zouyuanfeng) #7

还是一样的

       GroupPushClient jPushClient = new GroupPushClient(this.masterSecret, this.appKey);
       ClientConfig clientConfig=ClientConfig.getInstance();
       clientConfig.setPushHostName("bjapi.jiguang.cn");
       jPushClient.sendGroupPush(xxx)
{
  "935055881cb3afce340d193f": {
    "msg_id": 65302197570932740,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  },
  "c9b2ea7ad4307bf8e61d2ccb": {
    "msg_id": 65302197570932740,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  },
  "42207462fd7e14922f8de07b": {
    "msg_id": 3051413381,
    "error": {
      "message": "cannot find user by this audience",
      "code": 1011
    }
  }
}

(KenChoi) #8

你先调用

ClientConfig clientConfig=ClientConfig.getInstance();
clientConfig.setPushHostName("bjapi.jiguang.cn");

改一下顺序


(Zouyuanfeng) #9

java.net.MalformedURLException: no protocol: bjapi.jiguang.cn/v3/grouppush


(KenChoi) #10

所以你的应该是
bjapi.push.jiguang.cn/v3/grouppush


(Zouyuanfeng) #11

java.net.MalformedURLException: no protocol: bjapi.push.jiguang.cn/v3/grouppush


#12

https://bjapi.push.jiguang.cn/v3/push/grouppush

北京的分组的域名是这个,我上面总结里面有说。


(KenChoi) #13

你这样

ClientConfig clientConfig=ClientConfig.getInstance();
clientConfig.setPushHostName("https://bjapi.push.jiguang.cn");
clientConfig.put(GROUP_PUSH_PATH, "/v3/push/grouppush");

(Zouyuanfeng) #14

终于可以了。。。


(KenChoi) #15

如果用了北京机房的话,要注意一下域名


#16

4 个帖子被分离到了新主题:北京域名,分组推送异常


#20

1 个帖子被合并到现存主题:北京域名,分组推送异常