Package cn.jpush.api

Class JPushClient


  • public class JPushClient
    extends java.lang.Object
    The global entrance of JPush API library.
    • Constructor Detail

      • JPushClient

        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey)
        Create a JPush Client.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
      • JPushClient

        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           cn.jiguang.common.connection.HttpProxy proxy,
                           cn.jiguang.common.ClientConfig conf)
        Create a JPush Client by custom Client configuration.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
        proxy - The proxy, if there is no proxy, should be null.
        conf - The client configuration. Can use ClientConfig.getInstance() as default.
      • JPushClient

        @Deprecated
        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           int maxRetryTimes)
        Deprecated.
        This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
        maxRetryTimes - The max retry times.
      • JPushClient

        @Deprecated
        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           int maxRetryTimes,
                           cn.jiguang.common.connection.HttpProxy proxy)
        Deprecated.
        This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
        maxRetryTimes - The max retry times.
        proxy - The proxy, if there is no proxy, should be null.
      • JPushClient

        @Deprecated
        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           int maxRetryTimes,
                           cn.jiguang.common.connection.HttpProxy proxy,
                           cn.jiguang.common.ClientConfig conf)
        Deprecated.
        Create a JPush Client by custom Client configuration. If you are using JPush privacy cloud, maybe this constructor is what you needed. This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
        maxRetryTimes - Client request retry times.
        proxy - The proxy, if there is no proxy, should be null.
        conf - The client configuration. Can use ClientConfig.getInstance() as default.
      • JPushClient

        @Deprecated
        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           int maxRetryTimes,
                           cn.jiguang.common.connection.HttpProxy proxy,
                           cn.jiguang.common.ClientConfig conf,
                           boolean apnsProduction,
                           long timeToLive)
        Deprecated.
        Create a JPush Client by custom Client configuration with global settings. If you are using JPush privacy cloud, and you want different settings from default globally, maybe this constructor is what you needed. This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setGlobalPushSetting} instead of this constructor.
        Parameters:
        masterSecret - API access secret of the appKey.
        appKey - The KEY of one application on JPush.
        maxRetryTimes - Client request retry times.
        proxy - The proxy, if there is no proxy, should be null.
        conf - The client configuration. Can use ClientConfig.getInstance() as default.
        apnsProduction - Global APNs environment setting. It will override PushPayload Options.
        timeToLive - Global time_to_live setting. It will override PushPayload Options.
      • JPushClient

        @Deprecated
        public JPushClient​(java.lang.String masterSecret,
                           java.lang.String appKey,
                           boolean apnsProduction,
                           long timeToLive)
        Deprecated.
        Create a JPush Client with global settings. 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#setGlobalPushSetting} instead of this constructor.
        Parameters:
        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.
    • Method Detail

      • getPushClient

        public PushClient getPushClient()
      • sendPush

        public PushResult sendPush​(PushPayload pushPayload)
                            throws cn.jiguang.common.resp.APIConnectionException,
                                   cn.jiguang.common.resp.APIRequestException
        Send a push with PushPayload object.
        Parameters:
        pushPayload - payload object of a push.
        Returns:
        PushResult The result object of a Push. Can be printed to a JSON.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendPush

        public PushResult sendPush​(java.lang.String payloadString)
                            throws cn.jiguang.common.resp.APIConnectionException,
                                   cn.jiguang.common.resp.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.
        Parameters:
        payloadString - payload of a push.
        Returns:
        PushResult. Can be printed to a JSON.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendPushValidate

        public PushResult sendPushValidate​(PushPayload payload)
                                    throws cn.jiguang.common.resp.APIConnectionException,
                                           cn.jiguang.common.resp.APIRequestException
        Validate a push action, but do NOT send it actually.
        Parameters:
        payload - payload of a push.
        Returns:
        PushResult. Can be printed to a JSON.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendPushValidate

        public PushResult sendPushValidate​(java.lang.String payloadString)
                                    throws cn.jiguang.common.resp.APIConnectionException,
                                           cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getCidList

        public CIDResult getCidList​(int count,
                                    java.lang.String type)
                             throws cn.jiguang.common.resp.APIConnectionException,
                                    cn.jiguang.common.resp.APIRequestException
        Get cid list, the data form of cid is appKey-uuid.
        Parameters:
        count - the count of cid list, from 1 to 1000. default is 1.
        type - default is push, option: schedule
        Returns:
        CIDResult, an array of cid
        Throws:
        cn.jiguang.common.resp.APIConnectionException - connect exception
        cn.jiguang.common.resp.APIRequestException - request exception
      • getReportReceiveds

        public ReceivedsResult getReportReceiveds​(java.lang.String msgIds)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Get received report.
        Parameters:
        msgIds - 100 msgids to batch getting is supported.
        Returns:
        ReceivedResult. Can be printed to JSON.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getReportUsers

        public UsersResult getReportUsers​(cn.jiguang.common.TimeUnit timeUnit,
                                          java.lang.String start,
                                          int duration)
                                   throws cn.jiguang.common.resp.APIConnectionException,
                                          cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getReportMessages

        public MessagesResult getReportMessages​(java.lang.String msgIds)
                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getMessageStatus

        public java.util.Map<java.lang.String,​MessageStatus> getMessageStatus​(CheckMessagePayload payload)
                                                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                                                    cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendNotificationAll

        public PushResult sendNotificationAll​(java.lang.String alert)
                                       throws cn.jiguang.common.resp.APIConnectionException,
                                              cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendNotificationAll

        public PushResult sendNotificationAll​(java.lang.String alert,
                                              SMS sms)
                                       throws cn.jiguang.common.resp.APIConnectionException,
                                              cn.jiguang.common.resp.APIRequestException
        Send a notification to all. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The notification content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        Returns:
        push result
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendAndroidNotificationWithAlias

        public PushResult sendAndroidNotificationWithAlias​(java.lang.String title,
                                                           java.lang.String alert,
                                                           java.util.Map<java.lang.String,​java.lang.String> extras,
                                                           java.lang.String... alias)
                                                    throws cn.jiguang.common.resp.APIConnectionException,
                                                           cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendAndroidNotificationWithAlias

        public PushResult sendAndroidNotificationWithAlias​(java.lang.String title,
                                                           java.lang.String alert,
                                                           SMS sms,
                                                           java.util.Map<java.lang.String,​java.lang.String> extras,
                                                           java.lang.String... alias)
                                                    throws cn.jiguang.common.resp.APIConnectionException,
                                                           cn.jiguang.common.resp.APIRequestException
        Send a notification to Android with alias. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The notification title.
        alert - The notification content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra parameter.
        alias - The users' alias.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendAndroidNotificationWithRegistrationID

        public PushResult sendAndroidNotificationWithRegistrationID​(java.lang.String title,
                                                                    java.lang.String alert,
                                                                    java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                    java.lang.String... registrationID)
                                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                                    cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendAndroidNotificationWithRegistrationID

        public PushResult sendAndroidNotificationWithRegistrationID​(java.lang.String title,
                                                                    java.lang.String alert,
                                                                    SMS sms,
                                                                    java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                    java.lang.String... registrationID)
                                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                                    cn.jiguang.common.resp.APIRequestException
        Send a notification to Android with RegistrationID. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The notification title.
        alert - The notification content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra parameter.
        registrationID - The registration id generated by JPush.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(java.lang.String alert,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(java.lang.String alert,
                                                       SMS sms,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Send a notification to iOS with alias. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The notification content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra parameter.
        alias - The users' alias.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(IosAlert alert,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with alias. If you want to send alert as a Json object, maybe this method is what you needed.
        Parameters:
        alert - The wrapper of APNs alert.
        extras - The extra params.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(IosAlert alert,
                                                       SMS sms,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with alias. If you want to send alert as a Json object, maybe this method is what you needed. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The wrapper of APNs alert.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra params.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(com.google.gson.JsonObject alert,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with alias. If you want to send alert as a Json object, maybe this method is what you needed.
        Parameters:
        alert - The JSON object of APNs alert.
        extras - The extra params.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithAlias

        public PushResult sendIosNotificationWithAlias​(com.google.gson.JsonObject alert,
                                                       SMS sms,
                                                       java.util.Map<java.lang.String,​java.lang.String> extras,
                                                       java.lang.String... alias)
                                                throws cn.jiguang.common.resp.APIConnectionException,
                                                       cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with alias. If you want to send alert as a Json object, maybe this method is what you needed. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The JSON object of APNs alert.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra params.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(java.lang.String alert,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(java.lang.String alert,
                                                                SMS sms,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with registrationIds. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The notification content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra params.
        registrationID - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(IosAlert alert,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with registrationIds. If you want to send alert as a Json object, maybe this method is what you needed.
        Parameters:
        alert - The wrapper of APNs alert.
        extras - The extra params.
        registrationID - The registration ids.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(IosAlert alert,
                                                                SMS sms,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with registrationIds. If you want to send alert as a Json object, maybe this method is what you needed. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The wrapper of APNs alert.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra params.
        registrationID - The registration ids.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(com.google.gson.JsonObject alert,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with registrationIds. If you want to send alert as a Json object, maybe this method is what you needed.
        Parameters:
        alert - The wrapper of APNs alert.
        extras - The extra params.
        registrationID - The registration ids.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosNotificationWithRegistrationID

        public PushResult sendIosNotificationWithRegistrationID​(com.google.gson.JsonObject alert,
                                                                SMS sms,
                                                                java.util.Map<java.lang.String,​java.lang.String> extras,
                                                                java.lang.String... registrationID)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Send an iOS notification with registrationIds. If you want to send alert as a Json object, maybe this method is what you needed. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        alert - The JSON object of APNs alert.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        extras - The extra params.
        registrationID - The registration ids.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendMessageAll

        public PushResult sendMessageAll​(java.lang.String msgContent)
                                  throws cn.jiguang.common.resp.APIConnectionException,
                                         cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendMessageAll

        public PushResult sendMessageAll​(java.lang.String msgContent,
                                         SMS sms)
                                  throws cn.jiguang.common.resp.APIConnectionException,
                                         cn.jiguang.common.resp.APIRequestException
        Send a message to all If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendAndroidMessageWithAlias

        public PushResult sendAndroidMessageWithAlias​(java.lang.String title,
                                                      java.lang.String msgContent,
                                                      java.lang.String... alias)
                                               throws cn.jiguang.common.resp.APIConnectionException,
                                                      cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendAndroidMessageWithAlias

        public PushResult sendAndroidMessageWithAlias​(java.lang.String title,
                                                      java.lang.String msgContent,
                                                      SMS sms,
                                                      java.lang.String... alias)
                                               throws cn.jiguang.common.resp.APIConnectionException,
                                                      cn.jiguang.common.resp.APIRequestException
        Send an Android message with alias. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The message title.
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendAndroidMessageWithRegistrationID

        public PushResult sendAndroidMessageWithRegistrationID​(java.lang.String title,
                                                               java.lang.String msgContent,
                                                               java.lang.String... registrationID)
                                                        throws cn.jiguang.common.resp.APIConnectionException,
                                                               cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendAndroidMessageWithRegistrationID

        public PushResult sendAndroidMessageWithRegistrationID​(java.lang.String title,
                                                               java.lang.String msgContent,
                                                               SMS sms,
                                                               java.lang.String... registrationID)
                                                        throws cn.jiguang.common.resp.APIConnectionException,
                                                               cn.jiguang.common.resp.APIRequestException
        Send an Android message with registration id. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The message title.
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        registrationID - The registration id list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosMessageWithAlias

        public PushResult sendIosMessageWithAlias​(java.lang.String title,
                                                  java.lang.String msgContent,
                                                  java.lang.String... alias)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendIosMessageWithAlias

        public PushResult sendIosMessageWithAlias​(java.lang.String title,
                                                  java.lang.String msgContent,
                                                  SMS sms,
                                                  java.lang.String... alias)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Send an iOS message with alias. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The message title.
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        alias - The alias list.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendIosMessageWithRegistrationID

        public PushResult sendIosMessageWithRegistrationID​(java.lang.String title,
                                                           java.lang.String msgContent,
                                                           java.lang.String... registrationID)
                                                    throws cn.jiguang.common.resp.APIConnectionException,
                                                           cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendIosMessageWithRegistrationID

        public PushResult sendIosMessageWithRegistrationID​(java.lang.String title,
                                                           java.lang.String msgContent,
                                                           SMS sms,
                                                           java.lang.String... registrationID)
                                                    throws cn.jiguang.common.resp.APIConnectionException,
                                                           cn.jiguang.common.resp.APIRequestException
        Send an iOS message with registration id. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The message title.
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        registrationID - The registrationIds generated by JPush.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • sendMessageWithRegistrationID

        public PushResult sendMessageWithRegistrationID​(java.lang.String title,
                                                        java.lang.String msgContent,
                                                        java.lang.String... registrationID)
                                                 throws cn.jiguang.common.resp.APIConnectionException,
                                                        cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • sendMessageWithRegistrationID

        public PushResult sendMessageWithRegistrationID​(java.lang.String title,
                                                        java.lang.String msgContent,
                                                        SMS sms,
                                                        java.lang.String... registrationID)
                                                 throws cn.jiguang.common.resp.APIConnectionException,
                                                        cn.jiguang.common.resp.APIRequestException
        Send a message with registrationIds. If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
        Parameters:
        title - The message title.
        msgContent - The message content.
        sms - The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
        registrationID - The registrationIds generated by JPush.
        Returns:
        push result.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getDeviceTagAlias

        public TagAliasResult getDeviceTagAlias​(java.lang.String registrationId)
                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • updateDeviceTagAlias

        public cn.jiguang.common.resp.DefaultResult updateDeviceTagAlias​(java.lang.String registrationId,
                                                                         boolean clearAlias,
                                                                         boolean clearTag)
                                                                  throws cn.jiguang.common.resp.APIConnectionException,
                                                                         cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • updateDeviceTagAlias

        public cn.jiguang.common.resp.DefaultResult updateDeviceTagAlias​(java.lang.String registrationId,
                                                                         java.lang.String alias,
                                                                         java.util.Set<java.lang.String> tagsToAdd,
                                                                         java.util.Set<java.lang.String> tagsToRemove)
                                                                  throws cn.jiguang.common.resp.APIConnectionException,
                                                                         cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getTagList

        public TagListResult getTagList()
                                 throws cn.jiguang.common.resp.APIConnectionException,
                                        cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • isDeviceInTag

        public cn.jiguang.common.resp.BooleanResult isDeviceInTag​(java.lang.String theTag,
                                                                  java.lang.String registrationID)
                                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                                  cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • addRemoveDevicesFromTag

        public cn.jiguang.common.resp.DefaultResult addRemoveDevicesFromTag​(java.lang.String theTag,
                                                                            java.util.Set<java.lang.String> toAddUsers,
                                                                            java.util.Set<java.lang.String> toRemoveUsers)
                                                                     throws cn.jiguang.common.resp.APIConnectionException,
                                                                            cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • deleteTag

        public cn.jiguang.common.resp.DefaultResult deleteTag​(java.lang.String theTag,
                                                              java.lang.String platform)
                                                       throws cn.jiguang.common.resp.APIConnectionException,
                                                              cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getAliasDeviceList

        public AliasDeviceListResult getAliasDeviceList​(java.lang.String alias,
                                                        java.lang.String platform)
                                                 throws cn.jiguang.common.resp.APIConnectionException,
                                                        cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • deleteAlias

        public cn.jiguang.common.resp.DefaultResult deleteAlias​(java.lang.String alias,
                                                                java.lang.String platform)
                                                         throws cn.jiguang.common.resp.APIConnectionException,
                                                                cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • getUserOnlineStatus

        public java.util.Map<java.lang.String,​OnlineStatus> getUserOnlineStatus​(java.lang.String... registrationIds)
                                                                               throws cn.jiguang.common.resp.APIConnectionException,
                                                                                      cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • bindMobile

        public cn.jiguang.common.resp.DefaultResult bindMobile​(java.lang.String registrationId,
                                                               java.lang.String mobile)
                                                        throws cn.jiguang.common.resp.APIConnectionException,
                                                               cn.jiguang.common.resp.APIRequestException
        Throws:
        cn.jiguang.common.resp.APIConnectionException
        cn.jiguang.common.resp.APIRequestException
      • createSingleSchedule

        public ScheduleResult createSingleSchedule​(java.lang.String name,
                                                   java.lang.String time,
                                                   PushPayload push)
                                            throws cn.jiguang.common.resp.APIConnectionException,
                                                   cn.jiguang.common.resp.APIRequestException
        Create a single schedule.
        Parameters:
        name - The schedule name.
        time - The push time, format is 'yyyy-MM-dd HH:mm:ss'
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createDailySchedule

        public ScheduleResult createDailySchedule​(java.lang.String name,
                                                  java.lang.String start,
                                                  java.lang.String end,
                                                  java.lang.String time,
                                                  PushPayload push)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Create a daily schedule push everyday.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createDailySchedule

        public ScheduleResult createDailySchedule​(java.lang.String name,
                                                  java.lang.String start,
                                                  java.lang.String end,
                                                  java.lang.String time,
                                                  int frequency,
                                                  PushPayload push)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Create a daily schedule push with a custom frequency.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'
        frequency - The custom frequency.
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createWeeklySchedule

        public ScheduleResult createWeeklySchedule​(java.lang.String name,
                                                   java.lang.String start,
                                                   java.lang.String end,
                                                   java.lang.String time,
                                                   cn.jiguang.common.Week[] days,
                                                   PushPayload push)
                                            throws cn.jiguang.common.resp.APIConnectionException,
                                                   cn.jiguang.common.resp.APIRequestException
        Create a weekly schedule push every week at the appointed days.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'
        days - The appointed days.
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createWeeklySchedule

        public ScheduleResult createWeeklySchedule​(java.lang.String name,
                                                   java.lang.String start,
                                                   java.lang.String end,
                                                   java.lang.String time,
                                                   int frequency,
                                                   cn.jiguang.common.Week[] days,
                                                   PushPayload push)
                                            throws cn.jiguang.common.resp.APIConnectionException,
                                                   cn.jiguang.common.resp.APIRequestException
        Create a weekly schedule push with a custom frequency at the appointed days.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'.
        frequency - The custom frequency.
        days - The appointed days.
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createMonthlySchedule

        public ScheduleResult createMonthlySchedule​(java.lang.String name,
                                                    java.lang.String start,
                                                    java.lang.String end,
                                                    java.lang.String time,
                                                    java.lang.String[] points,
                                                    PushPayload push)
                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                    cn.jiguang.common.resp.APIRequestException
        Create a monthly schedule push every month at the appointed days.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'.
        points - The appointed days.
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • createMonthlySchedule

        public ScheduleResult createMonthlySchedule​(java.lang.String name,
                                                    java.lang.String start,
                                                    java.lang.String end,
                                                    java.lang.String time,
                                                    int frequency,
                                                    java.lang.String[] points,
                                                    PushPayload push)
                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                    cn.jiguang.common.resp.APIRequestException
        Create a monthly schedule push with a custom frequency at the appointed days.
        Parameters:
        name - The schedule name.
        start - The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
        end - The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
        time - The push time, format 'HH:mm:ss'.
        frequency - The custom frequency.
        points - The appointed days.
        push - The push payload.
        Returns:
        The created scheduleResult instance.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getSchedule

        public ScheduleResult getSchedule​(java.lang.String scheduleId)
                                   throws cn.jiguang.common.resp.APIConnectionException,
                                          cn.jiguang.common.resp.APIRequestException
        Get the schedule information by the schedule id.
        Parameters:
        scheduleId - The schedule id.
        Returns:
        The schedule information.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getScheduleMsgIds

        public ScheduleMsgIdsResult getScheduleMsgIds​(java.lang.String scheduleId)
                                               throws cn.jiguang.common.resp.APIConnectionException,
                                                      cn.jiguang.common.resp.APIRequestException
        Get the message id by the schedule id.
        Parameters:
        scheduleId - The schedule id.
        Returns:
        The message id list.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getScheduleList

        public ScheduleListResult getScheduleList()
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Get the schedule list size and the first page.
        Returns:
        The schedule list size and the first page.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • getScheduleList

        public ScheduleListResult getScheduleList​(int page)
                                           throws cn.jiguang.common.resp.APIConnectionException,
                                                  cn.jiguang.common.resp.APIRequestException
        Get the schedule list by the page.
        Parameters:
        page - The page to search.
        Returns:
        The schedule list of the appointed page.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • updateScheduleName

        public ScheduleResult updateScheduleName​(java.lang.String scheduleId,
                                                 java.lang.String name)
                                          throws cn.jiguang.common.resp.APIConnectionException,
                                                 cn.jiguang.common.resp.APIRequestException
        Update the schedule name
        Parameters:
        scheduleId - The schedule id.
        name - The new name.
        Returns:
        The schedule information after updated.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • enableSchedule

        public ScheduleResult enableSchedule​(java.lang.String scheduleId)
                                      throws cn.jiguang.common.resp.APIConnectionException,
                                             cn.jiguang.common.resp.APIRequestException
        Enable the schedule.
        Parameters:
        scheduleId - The schedule id.
        Returns:
        The schedule information after updated.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • disableSchedule

        public ScheduleResult disableSchedule​(java.lang.String scheduleId)
                                       throws cn.jiguang.common.resp.APIConnectionException,
                                              cn.jiguang.common.resp.APIRequestException
        Disable the schedule.
        Parameters:
        scheduleId - The schedule id.
        Returns:
        The schedule information after updated.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • updateScheduleTrigger

        public ScheduleResult updateScheduleTrigger​(java.lang.String scheduleId,
                                                    TriggerPayload trigger)
                                             throws cn.jiguang.common.resp.APIConnectionException,
                                                    cn.jiguang.common.resp.APIRequestException
        Update the trigger of the schedule.
        Parameters:
        scheduleId - The schedule id.
        trigger - The new trigger.
        Returns:
        The schedule information after updated.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • updateSchedulePush

        public ScheduleResult updateSchedulePush​(java.lang.String scheduleId,
                                                 PushPayload push)
                                          throws cn.jiguang.common.resp.APIConnectionException,
                                                 cn.jiguang.common.resp.APIRequestException
        Update the push content of the schedule.
        Parameters:
        scheduleId - The schedule id.
        push - The new push payload.
        Returns:
        The schedule information after updated.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • updateSchedule

        public ScheduleResult updateSchedule​(java.lang.String scheduleId,
                                             SchedulePayload payload)
                                      throws cn.jiguang.common.resp.APIConnectionException,
                                             cn.jiguang.common.resp.APIRequestException
        Update a schedule by the id.
        Parameters:
        scheduleId - The schedule id to update.
        payload - The new schedule payload.
        Returns:
        The new schedule information.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • deleteSchedule

        public void deleteSchedule​(java.lang.String scheduleId)
                            throws cn.jiguang.common.resp.APIConnectionException,
                                   cn.jiguang.common.resp.APIRequestException
        Delete a schedule by id.
        Parameters:
        scheduleId - The schedule id.
        Throws:
        cn.jiguang.common.resp.APIConnectionException - if a remote or network exception occurs.
        cn.jiguang.common.resp.APIRequestException - if a request exception occurs.
      • close

        public void close()