AppLifecycleTrigger
A trigger that triggers when the life cycle of an app changes.
The state changes that triggers are specified in states. If not specified (default) this trigger will trigger on all AppLifecycleState changes.
Typically used to make sure to collect measures when the app life cycle is changing, e.g., moved to the background or foreground. Some measures - like audio, bluetooth, and health - can only be collected when the app is in the foreground.
- Inheritance
-
- Object
- Serializable
- TriggerConfiguration
- AppLifecycleTrigger
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
AppLifecycleTrigger.fromJson
AppLifecycleTrigger
- Set<
AppLifecycleState> ? states
Creates an AppLifecycleTrigger that triggers whenever the app state changes. If states is not specified, it will trigger on all state change events.
Properties
fromJsonFunction
The function which can convert a JSON string to an object of this type.
states
getter/setter pair
The app life cycle states that fire this trigger.
Methods
toJson
Return a JSON encoding of this object.