cn.jpush.api
类 JPushClient

java.lang.Object
  继承者 cn.jpush.api.JPushClient

public class JPushClient
extends Object

The global entrance of JPush API library.


构造方法摘要
JPushClient(String masterSecret, String appKey)
          Create a JPush Client.
JPushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive)
          Create a JPush Client with global settings.
JPushClient(String masterSecret, String appKey, int maxRetryTimes)
           
JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy)
           
 
方法摘要
 DefaultResult addRemoveDevicesFromTag(String theTag, Set<String> toAddUsers, Set<String> toRemoveUsers)
           
 DefaultResult deleteAlias(String alias, String platform)
           
 DefaultResult deleteTag(String theTag, String platform)
           
 AliasDeviceListResult getAliasDeviceList(String alias, String platform)
           
 TagAliasResult getDeviceTagAlias(String registrationId)
           
 MessagesResult getReportMessages(String msgIds)
           
 ReceivedsResult getReportReceiveds(String msgIds)
          Get received report.
 UsersResult getReportUsers(TimeUnit timeUnit, String start, int duration)
           
 TagListResult getTagList()
           
 BooleanResult isDeviceInTag(String theTag, String registrationID)
           
 PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias)
          Shortcut
 PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID)
          Shortcut
 PushResult sendAndroidNotificationWithAlias(String title, String alert, Map<String,String> extras, String... alias)
          Shortcut
 PushResult sendAndroidNotificationWithRegistrationID(String title, String alert, Map<String,String> extras, String... registrationID)
          Shortcut
 PushResult sendIosMessageWithAlias(String title, String msgContent, String... alias)
          Shortcut
 PushResult sendIosMessageWithRegistrationID(String title, String msgContent, String... registrationID)
          Shortcut
 PushResult sendIosNotificationWithAlias(String alert, Map<String,String> extras, String... alias)
          Shortcut
 PushResult sendIosNotificationWithRegistrationID(String alert, Map<String,String> extras, String... registrationID)
          Shortcut
 PushResult sendMessageAll(String msgContent)
          Shortcut
 PushResult sendMessageWithRegistrationID(String title, String msgContent, String... registrationID)
          Shortcut
 PushResult sendNotificationAll(String alert)
          Shortcut
 PushResult sendPush(PushPayload pushPayload)
          Send a push with PushPayload object.
 PushResult sendPush(String payloadString)
          Send a push with JSON string.
 PushResult sendPushValidate(PushPayload paylaod)
          Validate a push action, but do NOT send it actually.
 PushResult sendPushValidate(String payloadString)
           
 DefaultResult updateDeviceTagAlias(String registrationId, boolean clearAlias, boolean clearTag)
           
 DefaultResult updateDeviceTagAlias(String registrationId, String alias, Set<String> tagsToAdd, Set<String> tagsToRemove)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JPushClient

public JPushClient(String masterSecret,
                   String appKey)
Create a JPush Client.

参数:
masterSecret - API access secret of the appKey.
appKey - The KEY of one application on JPush.

JPushClient

public JPushClient(String masterSecret,
                   String appKey,
                   int maxRetryTimes)

JPushClient

public JPushClient(String masterSecret,
                   String appKey,
                   int maxRetryTimes,
                   HttpProxy proxy)

JPushClient

public JPushClient(String masterSecret,
                   String appKey,
                   boolean apnsProduction,
                   long timeToLive)
Create a JPush 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.
方法详细信息

sendPush

public PushResult sendPush(PushPayload pushPayload)
                    throws APIConnectionException,
                           APIRequestException
Send a push with PushPayload object.

参数:
pushPayload - payload object of a push.
返回:
PushResult The result object of a Push. Can be printed to a JSON.
抛出:
APIConnectionException
APIRequestException

sendPush

public PushResult sendPush(String payloadString)
                    throws APIConnectionException,
                           APIRequestException
Send a push with JSON string. You can send a push JSON string directly with this method. Attention: globally settings cannot be affect this type of Push.

参数:
payloadString - payload of a push.
返回:
PushResult. Can be printed to a JSON.
抛出:
APIConnectionException
APIRequestException

sendPushValidate

public PushResult sendPushValidate(PushPayload paylaod)
                            throws APIConnectionException,
                                   APIRequestException
Validate a push action, but do NOT send it actually.

参数:
paylaod -
返回:
抛出:
APIConnectionException
APIRequestException

sendPushValidate

public PushResult sendPushValidate(String payloadString)
                            throws APIConnectionException,
                                   APIRequestException
抛出:
APIConnectionException
APIRequestException

getReportReceiveds

public ReceivedsResult getReportReceiveds(String msgIds)
                                   throws APIConnectionException,
                                          APIRequestException
Get received report.

参数:
msgIds - 100 msgids to batch getting is supported.
返回:
ReceivedResult. Can be printed to JSON.
抛出:
APIConnectionException
APIRequestException

getReportUsers

public UsersResult getReportUsers(TimeUnit timeUnit,
                                  String start,
                                  int duration)
                           throws APIConnectionException,
                                  APIRequestException
抛出:
APIConnectionException
APIRequestException

getReportMessages

public MessagesResult getReportMessages(String msgIds)
                                 throws APIConnectionException,
                                        APIRequestException
抛出:
APIConnectionException
APIRequestException

sendNotificationAll

public PushResult sendNotificationAll(String alert)
                               throws APIConnectionException,
                                      APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendAndroidNotificationWithAlias

public PushResult sendAndroidNotificationWithAlias(String title,
                                                   String alert,
                                                   Map<String,String> extras,
                                                   String... alias)
                                            throws APIConnectionException,
                                                   APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendAndroidNotificationWithRegistrationID

public PushResult sendAndroidNotificationWithRegistrationID(String title,
                                                            String alert,
                                                            Map<String,String> extras,
                                                            String... registrationID)
                                                     throws APIConnectionException,
                                                            APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendIosNotificationWithAlias

public PushResult sendIosNotificationWithAlias(String alert,
                                               Map<String,String> extras,
                                               String... alias)
                                        throws APIConnectionException,
                                               APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendIosNotificationWithRegistrationID

public PushResult sendIosNotificationWithRegistrationID(String alert,
                                                        Map<String,String> extras,
                                                        String... registrationID)
                                                 throws APIConnectionException,
                                                        APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendMessageAll

public PushResult sendMessageAll(String msgContent)
                          throws APIConnectionException,
                                 APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendAndroidMessageWithAlias

public PushResult sendAndroidMessageWithAlias(String title,
                                              String msgContent,
                                              String... alias)
                                       throws APIConnectionException,
                                              APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendAndroidMessageWithRegistrationID

public PushResult sendAndroidMessageWithRegistrationID(String title,
                                                       String msgContent,
                                                       String... registrationID)
                                                throws APIConnectionException,
                                                       APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendIosMessageWithAlias

public PushResult sendIosMessageWithAlias(String title,
                                          String msgContent,
                                          String... alias)
                                   throws APIConnectionException,
                                          APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendIosMessageWithRegistrationID

public PushResult sendIosMessageWithRegistrationID(String title,
                                                   String msgContent,
                                                   String... registrationID)
                                            throws APIConnectionException,
                                                   APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

sendMessageWithRegistrationID

public PushResult sendMessageWithRegistrationID(String title,
                                                String msgContent,
                                                String... registrationID)
                                         throws APIConnectionException,
                                                APIRequestException
Shortcut

抛出:
APIConnectionException
APIRequestException

getDeviceTagAlias

public TagAliasResult getDeviceTagAlias(String registrationId)
                                 throws APIConnectionException,
                                        APIRequestException
抛出:
APIConnectionException
APIRequestException

updateDeviceTagAlias

public DefaultResult updateDeviceTagAlias(String registrationId,
                                          boolean clearAlias,
                                          boolean clearTag)
                                   throws APIConnectionException,
                                          APIRequestException
抛出:
APIConnectionException
APIRequestException

updateDeviceTagAlias

public DefaultResult updateDeviceTagAlias(String registrationId,
                                          String alias,
                                          Set<String> tagsToAdd,
                                          Set<String> tagsToRemove)
                                   throws APIConnectionException,
                                          APIRequestException
抛出:
APIConnectionException
APIRequestException

getTagList

public TagListResult getTagList()
                         throws APIConnectionException,
                                APIRequestException
抛出:
APIConnectionException
APIRequestException

isDeviceInTag

public BooleanResult isDeviceInTag(String theTag,
                                   String registrationID)
                            throws APIConnectionException,
                                   APIRequestException
抛出:
APIConnectionException
APIRequestException

addRemoveDevicesFromTag

public DefaultResult addRemoveDevicesFromTag(String theTag,
                                             Set<String> toAddUsers,
                                             Set<String> toRemoveUsers)
                                      throws APIConnectionException,
                                             APIRequestException
抛出:
APIConnectionException
APIRequestException

deleteTag

public DefaultResult deleteTag(String theTag,
                               String platform)
                        throws APIConnectionException,
                               APIRequestException
抛出:
APIConnectionException
APIRequestException

getAliasDeviceList

public AliasDeviceListResult getAliasDeviceList(String alias,
                                                String platform)
                                         throws APIConnectionException,
                                                APIRequestException
抛出:
APIConnectionException
APIRequestException

deleteAlias

public DefaultResult deleteAlias(String alias,
                                 String platform)
                          throws APIConnectionException,
                                 APIRequestException
抛出:
APIConnectionException
APIRequestException


Copyright © 2014. All Rights Reserved.