Package cn.jpush.api.push.model
Class PushPayload
- java.lang.Object
-
- cn.jpush.api.push.model.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPushPayload.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PushPayloadalertAll(java.lang.String alert)The shortcut of building a simple alert notification object to all platforms and all audiencesstatic PushPayloadalertAll(java.lang.String alert, SMS sms)static PushPayloadfromJSON(java.lang.String payloadString)intgetSendno()booleanisGlobalExceedLength()booleanisIosExceedLength()static PushPayloadmessageAll(java.lang.String msgContent)The shortcut of building a simple message object to all platforms and all audiencesstatic PushPayloadmessageAll(java.lang.String msgContent, SMS sms)static PushPayload.BuildernewBuilder()The entrance for building a PushPayload object.voidresetOptionsApnsProduction(boolean apnsProduction)voidresetOptionsTimeToLive(long timeToLive)com.google.gson.JsonElementtoJSON()java.lang.StringtoString()
-
-
-
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()
-
isGlobalExceedLength
public boolean isGlobalExceedLength()
-
isIosExceedLength
public boolean isIosExceedLength()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-