PayloadBuilder

open class PayloadBuilder

A helper class for builder the tracking payload Use Properties class instead of this.

Author

MoEngage (abhishek@moengage.com)

Constructors

PayloadBuilder
Link copied to clipboard
open fun PayloadBuilder()
Use Properties instead.

Functions

build
Link copied to clipboard
open fun build(): JSONObject
Build the Event Payload and pass it to trackEvent Use Properties instead.
putAttrBoolean
Link copied to clipboard
open fun putAttrBoolean(attrName: String, attrValue: Boolean): PayloadBuilder
Add an boolean attribute value to the payload Use Properties instead.
putAttrDate
Link copied to clipboard
open fun putAttrDate(attrName: String, attrValue: Date): PayloadBuilder
open fun putAttrDate(attrName: String, dateString: String, dateFormat: String): PayloadBuilder
Add an Date attribute value to the payload Use Properties instead.
putAttrDateEpoch
Link copied to clipboard
open fun putAttrDateEpoch(attrName: String, attrValue: Long): PayloadBuilder
Add an Date attribute value to the payload Use Properties instead.
putAttrDouble
Link copied to clipboard
open fun putAttrDouble(attrName: String, attrValue: Double): PayloadBuilder
Add an double attribute value to the payload Use Properties instead.
putAttrFloat
Link copied to clipboard
open fun putAttrFloat(attrName: String, attrValue: Float): PayloadBuilder
Add an float attribute value to the payload Use Properties instead.
putAttrInt
Link copied to clipboard
open fun putAttrInt(attrName: String, attrValue: Int): PayloadBuilder
Add an integer attribute value to the payload Use Properties instead.
putAttrISO8601Date
Link copied to clipboard
open fun putAttrISO8601Date(@NonNull attrName: String, @NonNull attrValue: String): PayloadBuilder
Add a date attribute in ISO 8601 date format.
putAttrJSONArray
Link copied to clipboard
open fun putAttrJSONArray(@NonNull attrName: String, @NonNull attrValue: JSONArray): PayloadBuilder
Add a JSONArray attribute value to the payload Use Properties instead.
putAttrJSONObject
Link copied to clipboard
open fun putAttrJSONObject(@NonNull attrName: String, @NonNull attrValue: JSONObject): PayloadBuilder
Add a JSONObject attribute value to the payload Use Properties instead.
putAttrLocation
Link copied to clipboard
open fun putAttrLocation(attrName: String, attrValue: Location): PayloadBuilder
open fun putAttrLocation(attrName: String, attrValue: GeoLocation): PayloadBuilder
open fun putAttrLocation(attrName: String, latitude: Double, longitude: Double): PayloadBuilder
Add an Date attribute value to the payload Use Properties instead.
putAttrLong
Link copied to clipboard
open fun putAttrLong(attrName: String, attrValue: Long): PayloadBuilder
Add an long attribute value to the payload Use Properties instead.
putAttrObject
Link copied to clipboard
open fun putAttrObject(@NonNull attrName: String, @NonNull attrValue: Any): PayloadBuilder
Add a Object type attribute value to the payload.
putAttrString
Link copied to clipboard
open fun putAttrString(attrName: String, attrValue: String): PayloadBuilder
Add an String attribute value to the payload Use Properties instead.
setNonInteractive
Link copied to clipboard
open fun setNonInteractive(): PayloadBuilder
Marks an event as non-interactive.