React Native Library

See the full documentation or get the bluedot-react-native library on npm here.

 

import BluedotPointSdk from 'bluedot-react-native';
 
componentDidMount = async () => {
 // Before starting the Bluedot Point SDK ask for Location Permissions
 
 // ...
 
 const channelId = 'Bluedot React Native'
 const channelName = 'Bluedot React Native'
 const title = 'Bluedot Foreground Service'
 const content = "This app is running a foreground service using location services"
 
 // Foreground Service for Android to improve trigger rate - iOS will ignore this.
 BluedotPointSdk.setForegroundNotification(channelId, channelName, title, content, true)
 
 // If you would like to add custom event meta data
 BluedotPointSdk.setCustomEventMetaData({ userId: 'user_id_goes_here' })
 
 // Start Bluedot SDK
 BluedotPointSdk.authenticate('your_application_api_key', '<Always|WhileInUse>', () => console.log("On success"), () => console.log("On fail"))
 
 BluedotPointSdk.on('zoneInfoUpdate', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('checkedIntoFence', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('checkedOutFromFence', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('checkedIntoBeacon', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('checkedOutFromBeacon', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('startRequiringUserInterventionForBluetooth', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('stopRequiringUserInterventionForBluetooth', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('startRequiringUserInterventionForLocationServices', (event) => {
 // ...
 })
 
 BluedotPointSdk.on('stopRequiringUserInterventionForLocationServices', (event) => {
 // ...
 })
 }
Created by Melwin Chiramel on December 16, 2019