java.lang.Object | |
↳ | com.urbanairship.automation.Trigger |
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
@interface | Trigger.TriggerType |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ACTIVE_SESSION | Trigger type for active app sessions. | |||||||||
int | CUSTOM_EVENT_COUNT | Trigger type for custom events. | |||||||||
int | CUSTOM_EVENT_VALUE | Trigger type for custom events. | |||||||||
int | FEATURE_FLAG_INTERACTED | Trigger type for feature flag interracted event. | |||||||||
int | LIFE_CYCLE_APP_INIT | Trigger type for app initialization events. | |||||||||
int | LIFE_CYCLE_BACKGROUND | Trigger type for background events. | |||||||||
int | LIFE_CYCLE_FOREGROUND | Trigger type for foreground events. | |||||||||
int | REGION_ENTER | Trigger type for region enter events. | |||||||||
int | REGION_EXIT | Trigger type for region exit events. | |||||||||
int | SCREEN_VIEW | Trigger type for screen view events. | |||||||||
int | VERSION | Trigger type for version. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Trigger(int type, double goal, JsonPredicate predicate) | |||||||||||
Trigger(Parcel in) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | describeContents() | ||||||||||
boolean | equals(Object o) | ||||||||||
static Trigger |
fromJson(JsonValue value)
Parses a Trigger from a JsonValue.
| ||||||||||
double |
getGoal()
Returns the trigger's goal.
| ||||||||||
JsonPredicate |
getPredicate()
The trigger's predicate.
| ||||||||||
int |
getType()
Returns the trigger type.
| ||||||||||
int | hashCode() | ||||||||||
JsonValue |
toJsonValue()
Returns the objects represented as a JsonValue.
| ||||||||||
String | toString() | ||||||||||
void | writeToParcel(Parcel dest, int flags) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
| |||||||||||
From interface
com.urbanairship.json.JsonSerializable
|
Trigger type for active app sessions. Active app session triggers can be created with
newActiveSessionTriggerBuilder()
.
Trigger type for custom events. The count of events will be applied to
the triggers goal. Custom event triggers can be created
with newCustomEventTriggerBuilder()
.
Trigger type for custom events. The event's value will be applied to the triggers
goal. Custom event triggers can be created
with newCustomEventTriggerBuilder()
.
Trigger type for feature flag interracted event. The triggers can be create with
newFeatureFlagInteractedTriggerBuilder()
Trigger type for app initialization events. App initialization events
can be created with newAppInitTriggerBuilder()
.
Trigger type for background events. Background triggers
can be created with newBackgroundTriggerBuilder()
Trigger type for foreground events. Foreground triggers
can be created with newForegroundTriggerBuilder()
Trigger type for region enter events. Region enter triggers
can be created with newEnterRegionTriggerBuilder()
.
Trigger type for region exit events. Region exit triggers
can be created with newExitRegionTriggerBuilder()
.
Trigger type for screen view events. Screen events can be
created with newScreenTriggerBuilder()
.
Trigger type for version. Version triggers can be create with
newVersionTriggerBuilder(com.urbanairship.json.ValueMatcher)
Parses a Trigger from a JsonValue.
The expected JsonValue is a map containing:
- "goal": Required. The trigger's goal. Either the count of event occurrences or the aggregate value of custom event values ("custom_event_value").
- "predicate": Optional. Json predicate as defined by JsonPredicate
scheme.
- "type": Required. The trigger type.
value | The trigger JSON. |
---|
JsonException | If the JsonValue does not produce a valid Trigger. |
---|
Returns the trigger's goal. Once a trigger's goal is hit, it will cause the schedule's actions to perform, then the trigger will be reset.
The trigger's predicate. The predicate is applied to the event defined by the trigger's type. If the predicate matches the event, then the event's value will be applied to the trigger's goal.
Returns the trigger type.
Returns the objects represented as a JsonValue.