iOS SDK 15.6.7,
Android SDK 15.5.3,
Hello Screen Dynamic States,
Bluedot Cordova plugin 4.0.1,
Bluedot Xamarin Android wrapper 15.5.2,
Bluedot Xamarin iOS wrapper 15.6.6,
Bluedot React Native wrapper 2.3.0,
/* * Provide a multi-part callback for a fence with a Custom Action being checked into. * * Returns the following multipart status to the callback function: * Parameter 1: Array identifying fence: * name (String) * description (String) * ID (String) * Parameter 2: Array of strings identifying zone containing fence: * name (String) * description (String) * ID (String) * Parameter 3: Array of doubles identifying location which triggers fence: * Date of check-in (Integer - UNIX timestamp) * Latitude of check-in (Double) * Longitude of check-in (Double) * Bearing of check-in (Double) * Speed of check-in (Double) * Parameter 4: Fence is awaiting check-out (Boolean) * Parameter 5: JSON Object of custom data (JSON Object) */ exports.checkedIntoFenceCallback = function( callback ) { exec( callback, null, "BDPointSDK", "checkedIntoFenceCallback", [] ); }
This function provides a callback function to the SDK that will be called when the device has triggered a Geofence or crossed a Geoline™. Identifying information on the fence, the zone and location are passed back to the callback function as separate parameters.
This is a function that will be called when the device has triggered a Geofence or crossed a Geoline™.
The callback function has passed 5 parameters of the fence information, including the zone the fence is within; each entry contains the following information in the order provided:
These strings can be accessed by using an enum
as demonstrated in the bdFunctions.js
Javascript wrapper that is bundled with the Bluedot plug-in.
const zoneInfoEnum = { name: 0, description: 1, ID: 2 } const fenceInfoEnum = { name: 0, description: 1, ID: 2 } const locationInfoEnum = { timestamp: 0, latitude: 1, longitude: 2, bearing: 3, speed: 4 } /* * This delegate function receives the data of a fence with a Custom action that has been triggered by the SDK. * Refer to bluedotPointSDKCDVPlugin.js for more information. */ function fenceTrigger( fenceInfo, zoneInfo, locationInfo, willCheckOut, customData ) { // Extract details for a status update var fenceName = fenceInfo[ fenceInfoEnum.name ]; var zoneName = zoneInfo[ zoneInfoEnum.name ]; var lat = locationInfo [ locationInfoEnum.latitude ]; var lon = locationInfo [ locationInfoEnum.longitude ]; updateStatus( fenceName + " has been triggered in " + zoneName + " at " + lat + ":" + lon ); updateStatus( JSON.stringify(customData) ); if ( willCheckOut == true ) { updateStatus( "Fence is awaiting check-out" ) } }