0.1.5 • Published 4 years ago

react-native-colocator-library v0.1.5

Weekly downloads
25
License
Please contact Cr...
Repository
-
Last release
4 years ago

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)
);
0.1.4

4 years ago

0.1.5

4 years ago

2.7.1

4 years ago

2.7.0

4 years ago

2.5.3

5 years ago

2.5.2

5 years ago

2.4.0

5 years ago

1.0.0

5 years ago