react-native-colocator-library

0.1.5 • Public • Published

react-native-colocator-library

Getting started

$ npm install react-native-colocator-library --save

Mostly automatic installation

$ react-native link react-native-colocator-library

Additional installation steps

Android

Usage

import RNColocatorLibrary from 'react-native-colocator-library';

# Start Colocator library
RNColocatorLibrary.start("API_KEY")

# Stop Colocator library
RNColocatorLibrary.stop()

# Display Bluetooth permission popup (only in iOS)
RNColocatorLibrary.triggerBluetoothPermissionPopUp()

# Get device ID from Colocator library
RNColocatorLibrary.getDeviceID(id)=> {
  if (id) {
    console.log(id);
  }
})

# Add alias pair through Colocator library
RNColocatorLibrary.addAlias("KEY","VALUE")

# Set service notification for Colocator foreground service (only Android)
RNColocatorLibrary.setServiceNotificationInfo("SERVICE_NOTIFICATION_TEXT", kServiceNotificationIcon, "CHANNEL_ID")

# Request one location from Colocator Library
RNColocatorLibrary.requestLocation()

# Request location updates from Colocator Library
RNColocatorLibrary.registerLocationListener()

# Stop receiving location updates from Colocator Library
RNColocatorLibrary.unregisterLocationListener()

# Subscribe to location updates and handle location responses from Colocator
const colocatorEmitter = new NativeEventEmitter(RNColocatorLibrary);
subscription = colocatorEmitter.addListener(
   'LocationResponse', (response) => console.log(response)
);

/react-native-colocator-library/

    Package Sidebar

    Install

    npm i react-native-colocator-library

    Weekly Downloads

    1

    Version

    0.1.5

    License

    Please contact CrowdConnected for using this library.

    Unpacked Size

    359 MB

    Total Files

    15878

    Last publish

    Collaborators

    • crowdconnected