Subscribe Trip (iOS)
Explore how to subscribe to a trip on iOS with Trips v2.
For you to subscribe to a trip, you need to pass the tripID with the Roam.subscribeTrip("tripId")
method.
Once you subscribe to the trip, you will receive real time trip data in the listener methods
In order to subscribe to the trips with the listener method, you need to make sure the below is implemented.
To listen to location updates, create a class that implements RoamDeleagate
and then call Roam.delegate.
Set your RoamDelegate
in a code path that will be initialized and executed in the background. For example, ensure that your AppDelegate
and not the ViewController
implements RoamDelegate
. The reason being, AppDelegate
will be initialized in the background, whereas a ViewController
may not be.
Note: For tracking without user sessions, i.e., self tracking, you can only listen to location, errors and offline trip status data since the locations are not being sent to our servers for event processing.
You can access the subscribed trip response parameters below:
You can unsubscribe from trips using the tripID.
Last updated