1.0.23 • Published 6 months ago

react-native-delivery-livetrack v1.0.23

Weekly downloads
81
License
MIT
Repository
github
Last release
6 months ago

react-native-delivery-livetrack

Getting started

$ npm install @react-native-mapbox-gl/maps --save $ npm install npm install react-native-star-rating --save $ npm install react-native-vector-icons --save $ npm install --save https://github.com/iugotech/react-native-delivery-livetrack/tarball/master $ react-native link react-native-vector-icons

Mostly automatic installation

$ cd ios && pod install && cd ..

Usage

import React, {useState} from 'react';
....

import { LiveTrackMap, isHotTrackingLive, isOrderDelivered, retrieveHotTrackingInfo } from 'react-native-delivery-livetrack';

  const [data, setData] = useState(undefined)

//CHECK IF Tracking Started
 isHotTrackingLive("ABC123", "40331", "123")
      .then(success => {
          console.log("isHotTrackingLive Success:", success) 
      })
      .catch(err => {
          console.log("isHotTrackingLive Error:", err)
      })


// IF HotTracking Started (if received success response from above request), then retrieve the hot tracking info
  retrieveHotTrackingInfo("ABC123", "40331", "123")
      .then(data => {
          console.log("retrieveHotTrackingInfo Success:", data)
          
          // set data with returned response ==> data will be passed as props in below component
          setData(data)
      })
      .catch(err => {
          console.log("retrieveHotTrackingInfo Error:", err)
      }) 

// CHECK IF Order Delivered
  isOrderDelivered("ABC123", "40331", "123")
      .then(data => {
          console.log("isOrderedDelivered Success:", data)        
      })
      .catch(err => {
          console.log("isOrderDelivered Error:", err)
      }) 


// Handle orderDelivered event
handleOrderDelivered = () => {
  /* Order delivered. Remove LiveTrackMap */
}

// Rendering Map View --> render only if data is available
{ data && 
  <View 
    style={{
        height: '100%',
        backgroundColor: 'red'
    }}
  >
    <LiveTrackMap {...data} onDelivered={()=>{handleOrderDelivered}}/>

  </View>
}
1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.23

6 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago