react-native-geosentry
v1.1.1
Published
React Native wrapper for GeoSentry SDK
Downloads
116
Readme
react-native-geosentry
React Native wrapper for GeoSentry SDK
Installation
npm install react-native-geosentryUsage
import {
initialiseSDK,
requestLocationPermission,
requestIgnoreBatteryOptimizations,
stopTracking
} from 'react-native-geosentry';
// ...
// 1. Request necessary permissions
// You should call these at an appropriate time in your app flow
requestLocationPermission();
requestIgnoreBatteryOptimizations();
// 2. Initialize the SDK
// Replace with your actual credentials
const apiKey = 'YOUR_API_KEY';
const cipherKey = 'YOUR_CIPHER_KEY';
const userId = 'UNIQUE_USER_ID';
initialiseSDK(apiKey, cipherKey, userId)
.then((response) => {
console.log('GeoSentry SDK Initialized:', response);
})
.catch((error) => {
console.error('Initialization failed:', error);
});
// 3. Stop tracking when needed
stopTracking()
.then((response) => {
console.log('Tracking stopped:', response);
});API Reference
initialiseSDK(apiKey: string, cipherKey: string, userID: string): Promise<Object>
Initializes the GeoSentry SDK with the provided credentials.
apiKey: Your GeoSentry API Key.cipherKey: Your GeoSentry Cipher Key.userID: A unique identifier for the user being tracked.
stopTracking(): Promise<Object>
Stops the tracking service.
requestLocationPermission(): void
Requests location permissions from the user (Android/iOS).
requestIgnoreBatteryOptimizations(): void
Requests permission to ignore battery optimizations (Android) to ensure reliable background tracking.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
