java通过api给ios 指定.setAudience(Audience.registrationId(registrationId)) 发送一条当时app收到两条

xiangchang521
2017-08-25 04:41 1.2k 0
            ClientConfig config = ClientConfig.getInstance();
        config.setMaxRetryTimes(0);
        config.setConnectionTimeout(30 * 1000);    // 30 seconds
        config.setSSLVersion("TLSv1.1");        // JPush server supports SSLv3, TLSv1, TLSv1.1, TLSv1.2
        JPushClient jPushClient = new JPushClient(MASTER_SECRET, APP_KEY,null,config);

        PushPayload pushPayload = buildPushObject_android_cid(platform,registrationId,content);
        try {
            PushResult result = jPushClient.sendPush(pushPayload);
            logger.info("Got result - " + result);
        } catch (APIConnectionException e) {
                logger.error("Connection error. Should retry later. ", e);
        } catch (APIRequestException e) {
                logger.error("Error response from JPush server. Should review and fix it. ", e);
                logger.info("HTTP Status: " + e.getStatus());
                logger.info("Error Code: " + e.getErrorCode());
                logger.info("Error Message: " + e.getErrorMessage());
        }

1个回答

热门排序
  • 1、提供你设备的registrationID
    2、提供你设备收到的两条消息的msgid,是否一样