4.1.5 • Published 2 years ago

tookan-tracker-react-native-sdk v4.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

tookan-tracker-react-native-sdk

Sample project for implementing tookan-tracker-react-native-sdk module.

What is the use of this Package

React Native Tookan Tracker lets you add live location tracking to your mobile app via Tookan platform. This repo contains an example client app that has everything you need to get started in minutes. This repo written in JavaScript, checkout quickstart if your feel more comfortable with it.

Add and setup these packages to your project before adding tookan-tracker-react-native-sdk: react-native-maps (install + link) axios (install only) sp-react-native-mqtt (install + link) Note ->: After running react-native link sp-react-native-mqtt, Don't forget to add pod 'MQTTClient' in ios Pod file and the run pod install in ios. @mapbox/polyline (install only) Note: If you are using Tracking without UI then this library is not required.

Install

Install the library from npm: $ npm install --save tookan-tracker-react-native-sdk or $ yarn add tookan-tracker-react-native-sdk

Usage

With UI

import {MapTracking} from 'tookan-tracker-react-native-sdk'

export default class testTracking extends Component { render() { return ( <MapTracking jobId=”1234567” userId= ”123” polylineColor= ”pink” mapKey="Flightmap or Google Keys" mapType=1/> ); } }

Without UI

import {getSocketData} from 'tookan-tracker-react-native-sdk'

export default class testTracking extends Component {

getSocketData(your_jobId, your_user_id, data => { console.log(data); }); }

Props

PropTypeDefaultNote
jobIdstring (required)Tookan JobId that you want to track.
userIdstring (required)Tookan UserId.
mapTypenumber (required)For Googlemap = 1 and For Flightmap = 2.
rateSubmitActionStyle{{backgroundColor: 'red'}}To change style of Submit action on Rate UI set this prop
rateAlertTitlestring (optional)To set title on Alert after Rating done
rateAlertMessagestring (optional)To set message body on Alert PopUp after Rating
rateAlertOkTitlestring (optional)To set Ok title on Alert PopUp after Rating
isRateEnableInAppBoolean (optional)To Enable Rating
rateCommentPlaceholderstring (optional)Rate Comment Placeholder
rateSubmitActionTitlestring (optional)Rate Submit Action Button
mapKeystring (required)Google Map Key or Flightmap Key depend on mapType
polylineColorstring (required)Polyling Color
pathUpdateTimerNumber(in milliseconds)60000(60 sec)Time after which google direction hit will be called.
destinationIconImage sourceImage source used for indicating the destination spot on a map.
pickupIconImage sourceImage source used for indicating the pickup spot on a map.
deliveryIconImage sourceImage source used for indicating the delivery spot on a map.
agentMarkerImageImage sourceImage source used for indicating the agent marker on a map.
anchorXNumber0.4For adjusting the agent marker on x-axis.
anchorYNumber0.4For adjusting the agent marker on y-axis.
getDatafunctionFor getting raw data from sockets(with UI).

getSocketData(jobId,userId,callback):

This method is used to getting the raw data from sockets for without UI tracking.

getSocketData(this.state.jobId, this.state.userId, data => { console.log(data); });

getETA (For Without UI): This method is used to get ETA for job destination by inputing the start location and map key.

import {getSocketData,getETA} from 'tookan-tracker-react-native-sdk'

export default class testTracking extends Component {

getSocketData(your_jobId, your_user_id, data => { console.log(data); });

getETA( {latitude: '30.6942713', longitude: '76.8792693'}, 'google_map_key or flightmap key depend on mapType', 'mapType', data => { console.log(data); }, ); }

stopTracking():

This method is used to stop the tracking and disconnecting the sockets.

Npm Package Link tookan-tracker-react-native-sdk

4.0.9

2 years ago

4.1.4

2 years ago

4.1.3

2 years ago

4.1.5

2 years ago

4.1.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

4.0.8

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.7

2 years ago

4.0.6

2 years ago

4.0.3

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

3.0.0

2 years ago

2.0.0

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago