public class PushClient
extends java.lang.Object
For the following parameters, you can set them by instance creation. This action will override setting in PushPayload Optional. * apnsProduction If not present, the default is true. * timeToLive If not present, the default is 86400(s) (one day).
Can be used directly.
| Constructor and Description |
|---|
PushClient(java.lang.String masterSecret,
java.lang.String appKey)
Create a Push Client.
|
PushClient(java.lang.String masterSecret,
java.lang.String appKey,
boolean apnsProduction,
long timeToLive)
Deprecated.
|
PushClient(java.lang.String masterSecret,
java.lang.String appKey,
cn.jiguang.common.connection.HttpProxy proxy,
cn.jiguang.common.ClientConfig conf) |
PushClient(java.lang.String masterSecret,
java.lang.String appKey,
int maxRetryTimes)
Deprecated.
|
PushClient(java.lang.String masterSecret,
java.lang.String appKey,
int maxRetryTimes,
cn.jiguang.common.connection.HttpProxy proxy)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
BatchPushResult |
batchSendPush(java.lang.String url,
java.util.List<PushPayload> pushPayloadList) |
BatchPushResult |
batchSendPushByAlias(java.util.List<PushPayload> pushPayloadList) |
BatchPushResult |
batchSendPushByRegId(java.util.List<PushPayload> pushPayloadList) |
void |
close() |
CIDResult |
getCidList(int count,
java.lang.String type)
Get cid list, the data form of cid is appKey-uuid.
|
PushResult |
sendPush(PushPayload pushPayload) |
PushResult |
sendPush(java.lang.String payloadString) |
PushResult |
sendPushValidate(PushPayload pushPayload) |
PushResult |
sendPushValidate(java.lang.String payloadString) |
void |
setBaseUrl(java.lang.String baseUrl) |
void |
setDefaults(boolean apnsProduction,
long timeToLive)
Deprecated.
|
void |
setHttpClient(cn.jiguang.common.connection.IHttpClient client) |
public PushClient(java.lang.String masterSecret,
java.lang.String appKey)
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.@Deprecated
public PushClient(java.lang.String masterSecret,
java.lang.String appKey,
int maxRetryTimes)
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.maxRetryTimes - The max retry times.@Deprecated
public PushClient(java.lang.String masterSecret,
java.lang.String appKey,
int maxRetryTimes,
cn.jiguang.common.connection.HttpProxy proxy)
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.maxRetryTimes - max retry timesproxy - The max retry times.public PushClient(java.lang.String masterSecret,
java.lang.String appKey,
cn.jiguang.common.connection.HttpProxy proxy,
cn.jiguang.common.ClientConfig conf)
@Deprecated
public PushClient(java.lang.String masterSecret,
java.lang.String appKey,
boolean apnsProduction,
long timeToLive)
If you want different settings from default globally, this constructor is what you needed. This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig} instead of this constructor.
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.apnsProduction - Global APNs environment setting. It will override PushPayload Options.timeToLive - Global time_to_live setting. It will override PushPayload Options.@Deprecated
public void setDefaults(boolean apnsProduction,
long timeToLive)
apnsProduction - Global APNs environment setting. It will override PushPayload Options.timeToLive - Global time_to_live setting. It will override PushPayload Options.public void setBaseUrl(java.lang.String baseUrl)
public PushResult sendPush(PushPayload pushPayload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic PushResult sendPushValidate(PushPayload pushPayload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic PushResult sendPush(java.lang.String payloadString) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic PushResult sendPushValidate(java.lang.String payloadString) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic BatchPushResult batchSendPushByRegId(java.util.List<PushPayload> pushPayloadList) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic BatchPushResult batchSendPushByAlias(java.util.List<PushPayload> pushPayloadList) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic BatchPushResult batchSendPush(java.lang.String url, java.util.List<PushPayload> pushPayloadList) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic CIDResult getCidList(int count, java.lang.String type) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
count - the count of cid list, from 1 to 1000. default is 1.type - default is "push", option: "schedule"cn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic void setHttpClient(cn.jiguang.common.connection.IHttpClient client)
public void close()
Copyright © 2019. All Rights Reserved.