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.


字段摘要
static String HOST_NAME_SSL
           
static String PUSH_PATH
           
static String PUSH_VALIDATE_PATH
           
 
构造方法摘要
PushClient(String masterSecret, String appKey)
          Create a Push Client.
PushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive)
          Create a Push Client with global settings.
PushClient(String masterSecret, String appKey, int maxRetryTimes)
           
PushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy)
          Create a Push Client with max retry times.
 
方法摘要
 PushResult sendPush(PushPayload pushPayload)
           
 PushResult sendPush(String payloadString)
           
 PushResult sendPushValidate(PushPayload pushPayload)
           
 PushResult sendPushValidate(String payloadString)
           
 void setBaseUrl(String baseUrl)
           
 void setDefaults(boolean apnsProduction, long timeToLive)
           
 
从类 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.