A Promise that resolves with a subscription object that you can use to remove the set listener.
You can use this function along with getTimelineUpdates to stay up to date with the latest events in the timeline. For example, to make sure you don't miss out on timeline updates, you can first set an update listener using this method, then follow up by calling getTimelineUpdates to query for potential updates since the last update you received.
Returns timeline events, such as transport and stationary events, that were captured during the specified time range. The events are ordered from oldest to newest.
The start timestamp (in milliseconds, inclusive) of the time range.
The end timestamp (in milliseconds, inclusive) of the time range.
OptionalincludeProvisionalEvents: booleanOptional parameter. Set to true if you want to include provisional events. Default is false.
A Promise that resolves with an array of Event objects that occurred in the specified time range. If no events are found, an empty array is returned.
Events that were captured outside the specified date range are not returned, even if they were updated during this date range. To get all updates, regardless of when an event was captured, use the getTimelineUpdates function instead.
Returns all updated events in the event timeline after the specified date, sorted by the last update time.
The timestamp (in milliseconds) to retrieve updates from. The specified timestamp is exclusive.
OptionalincludeProvisionalEvents: booleanOptional parameter. Set to true if you want to include provisional events. Default is false.
A Promise that resolves with an array of Event objects that occurred in the specified time range. If no events are found, an empty array is returned.
This method returns all events that started after afterEpochTimeMs, but it may also return events
that started before afterEpochTimeMs, if they were updated afterward. The returned result is not
necessarily the complete list of events that were captured by the SDK from the result's first event until the
last, because events that were not updated will be excluded. To get a complete and ordered list of
events for a given date range, use getTimelineEvents instead.
You can use this method along with addTimelineUpdateListener to stay up to date with the latest events in the timeline. For example, to make sure you don't miss out on timeline updates, you can first set an update listener, then follow up by using this method to query for potential updates since the last update you received.
Sets the tags that will be assigned to a detected transport.
The transport tags to set
The provided tags will be assigned to a transport at the moment the transport ends. When you receive an Event representing the ended transport, it will include these tags.
The supplied tags are persisted and applied to future transports, even after the app is restarted. By calling this method again, you will replace the tags that will be assigned to future transports.
You can include up to 6 tags (key-value pairs), and each tag component (key or value) must be at most 256 characters.
Starts delivering periodic trip location updates to the provided listener. To stop the updates, call stopReceivingTripLocationUpdates.
The desired time interval, in seconds, between successive location updates. Must be at least 1 second. The actual delivery cadence may vary depending on system conditions.
A listener that is invoked with the user's current location during a trip.
A Promise that resolves with a TripLocationUpdatesStartResult describing whether
updates were started successfully or the reason they could not be started.
If the result is not SUCCESS, any previously registered listener is left unchanged.
SUCCESS, the provided listener becomes the active listener.
A previously registered listener will no longer receive trip location updates.SUCCESS, no changes will be made to
the previously registered listener. It remains active and continues receiving location updates.import SentianceEventTimeline from "@sentiance-react-native/event-timeline";
const intervalInSeconds = 10;
const result = await SentianceEventTimeline.startReceivingTripLocationUpdates(
intervalInSeconds,
(tripLocation) => console.log(tripLocation),
);
if (result === "SUCCESS") {
console.log("Trip location updates started successfully");
}
Stops delivering trip location updates.
Call this method to stop delivery of location updates to the listener that you previously supplied to startReceivingTripLocationUpdates.
Sets a listener that is invoked when the event timeline is updated. The listener receives the updated events. An update can be triggered by the start of a new event, and the update or end of an existing one. Every invocation of the listener will deliver an event that has a last update time that is equal to or greater than the previously delivered event's last update time.