Basic integration

Once the module has been installed and you have configured your publishable token, you can use the methods of the SDK.

In case you are not using React Native, you can refer to the Android version, or the iOS version.

[info] Step-By-Step Onboarding

Integrating HyperTrack React Native SDK in your app?

We recommend you try our new interactive step-by-step onboarding

React Native Onboarding

Step 1: Define a user

To be able to identify the device, the SDK needs a user id. You can create a new user user on the SDK, and specify a string identifier. This is a network call that requires the device to be online.

The SDK provides a getOrCreateUser API - which creates a new user, or fetches an existing user for a given unique_id. The unique id can be used to save your internal identifier for the user.

Argument Description
name Name of the user
phone Phone number of the user
unique_id Vendor identifier for the user
RNHyperTrack.getOrCreateUser(
    "User name",
    "+15103094946",
    "user_12345"
).then(
    (success) => {
        // success callback
        console.log(success);
    }, (error) => {
        // error callback
        console.log(error);
    }
);

Step 2: Resume tracking

Tracking is automatically started if there is atleast one action assigned to the user. You can force pause tracking by calling pauseTracking method in which case tracking won't be resumed even after assigning an action to the user. To resume the force paused tracking use resumeTracking method. Tracking will be started as soon as an action is assigned to the user.

RNHyperTrack.resumeTracking();

Step 3: View dashboard

Install your app with the HyperTrack SDK on a device and begin tracking on the Dashboard. You would see the user’s current state on the HyperTrack dashboard. If you click on the user, you should be able to view the user's trips and stops.

Step 4: Pause tracking

Tracking is automatically started if there is atleast one action assigned to the user. You can force pause tracking by calling pauseTracking method in which case tracking won't be resumed even after assigning an action to the user.

RNHyperTrack.pauseTracking();

results matching ""

    No results matching ""