cn.jpush.api.push
类 PushClient
java.lang.Object
cn.jpush.api.push.PushClient
public class PushClient
- extends Object
Entrance for sending Push.
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.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HOST_NAME_SSL
public static final String HOST_NAME_SSL
- 另请参见:
- 常量字段值
PUSH_PATH
public static final String PUSH_PATH
- 另请参见:
- 常量字段值
PUSH_VALIDATE_PATH
public static final String PUSH_VALIDATE_PATH
- 另请参见:
- 常量字段值
PushClient
public PushClient(String masterSecret,
String appKey)
- Create a Push Client.
- 参数:
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.
PushClient
public PushClient(String masterSecret,
String appKey,
int maxRetryTimes)
PushClient
public PushClient(String masterSecret,
String appKey,
int maxRetryTimes,
HttpProxy proxy)
- Create a Push Client with max retry times.
- 参数:
masterSecret - API access secret of the appKey.appKey - The KEY of one application on JPush.maxRetryTimes - max retry times
PushClient
public PushClient(String masterSecret,
String appKey,
boolean apnsProduction,
long timeToLive)
- Create a Push Client with global settings.
If you want different settings from default globally, this constructor is what you needed.
- 参数:
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.
setDefaults
public void setDefaults(boolean apnsProduction,
long timeToLive)
setBaseUrl
public void setBaseUrl(String baseUrl)
sendPush
public PushResult sendPush(PushPayload pushPayload)
throws APIConnectionException,
APIRequestException
- 抛出:
APIConnectionException
APIRequestException
sendPushValidate
public PushResult sendPushValidate(PushPayload pushPayload)
throws APIConnectionException,
APIRequestException
- 抛出:
APIConnectionException
APIRequestException
sendPush
public PushResult sendPush(String payloadString)
throws APIConnectionException,
APIRequestException
- 抛出:
APIConnectionException
APIRequestException
sendPushValidate
public PushResult sendPushValidate(String payloadString)
throws APIConnectionException,
APIRequestException
- 抛出:
APIConnectionException
APIRequestException
Copyright © 2014. All Rights Reserved.