Class PushPayload

  • All Implemented Interfaces:
    PushModel

    public class PushPayload
    extends java.lang.Object
    implements PushModel
    The object you should build for sending a push. Basically start with newBuilder() method to build a PushPayload object. alertAll() is a shortcut for quickly build payload of alert to all platform and all audience; mesageAll() is a shortcut for quickly build payload of message to all platform and all audience.
    • Method Detail

      • newBuilder

        public static PushPayload.Builder newBuilder()
        The entrance for building a PushPayload object.
        Returns:
        PushPayload builder
      • alertAll

        public static PushPayload alertAll​(java.lang.String alert)
        The shortcut of building a simple alert notification object to all platforms and all audiences
        Parameters:
        alert - The alert message.
        Returns:
        PushPayload
      • alertAll

        public static PushPayload alertAll​(java.lang.String alert,
                                           SMS sms)
      • messageAll

        public static PushPayload messageAll​(java.lang.String msgContent)
        The shortcut of building a simple message object to all platforms and all audiences
        Parameters:
        msgContent - The message content.
        Returns:
        PushPayload
      • messageAll

        public static PushPayload messageAll​(java.lang.String msgContent,
                                             SMS sms)
      • fromJSON

        public static PushPayload fromJSON​(java.lang.String payloadString)
      • resetOptionsApnsProduction

        public void resetOptionsApnsProduction​(boolean apnsProduction)
      • resetOptionsTimeToLive

        public void resetOptionsTimeToLive​(long timeToLive)
      • getSendno

        public int getSendno()
      • toJSON

        public com.google.gson.JsonElement toJSON()
        Specified by:
        toJSON in interface PushModel
      • isGlobalExceedLength

        public boolean isGlobalExceedLength()
      • isIosExceedLength

        public boolean isIosExceedLength()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object