Methods reference

The React Native wrapper has methods for some commonly used methods in the native SDKs. Methods do not return anything, and use callback functions to return objects and method results.

Example

Initialise with your key

import RNHyperTrack from 'react-native-hypertrack';


export default class MyApp extends Component {
  constructor() {
    super();
    // Initialize HyperTrack wrapper
    RNHyperTrack.initialize(config.HT_PUBLISHABLE_KEY);
  }
}

Start a trip

RNHyperTrack.startTrip(
  DRIVER_ID,
  [TASK_ID_1, TASK_ID_2...],
  (successValue) => {
    // Handle Success

    // Get the trip object by successValue.trip
  },
  (error) => {
    // Handle error
  }
);

Completing a task

RNHyperTrack.completeTask(
  TASK_ID,
  (successValue) => {
     // Handle Success
  },
  (error) => {
    // Handle error
  }
);

Methods

Callbacks

results matching ""

    No results matching ""