Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,4 @@ Added:
## 0.1.22

- Updated the Roam SDK to latest versions.
- Added additional data points to location listener
- Added additional data points to location listener
8 changes: 4 additions & 4 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,16 @@ const publishAndSave = (jsonMetadata) => {
}

const batchProcess = (enable, syncHour) => {
NativeModules.RNRoam.batchProcess(enable, syncHour);
};
NativeModules.RNRoam.batchProcess(enable, syncHour)
}

const stopPublishing = () => {
NativeModules.RNRoam.stopPublishing()
}

const createGeofence = (geofence) => {
NativeModules.RNRoam.createGeofence(geofence);
};
NativeModules.RNRoam.createGeofence(geofence)
}

const startTracking = (trackingMode) => {
NativeModules.RNRoam.startTracking(trackingMode)
Expand Down
92 changes: 46 additions & 46 deletions js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ const Publish = {
const createUser = (
description: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.createUser(
description,
null,
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -122,29 +122,29 @@ const toggleEvents = (
location: any,
movingGeofence: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.toggleEvents(
geofence,
trip,
location,
movingGeofence,
successCallback,
errorCallback
errorCallback,
);
};

const toggleListener = (
location: any,
event: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.toggleListener(
location,
event,
successCallback,
errorCallback
errorCallback,
);
};

Expand Down Expand Up @@ -221,7 +221,7 @@ class RoamTrip {
stops: any,
isLocal: any,
tripId: any,
userId: any
userId: any,
) {
this.metadata = metadata;
this.description = description;
Expand All @@ -248,7 +248,7 @@ class RoamTripStop {
name: any,
address: any,
geometryRadius: any,
geometry: any
geometry: any,
) {
this.id = id;
this.metadata = metadata;
Expand Down Expand Up @@ -281,7 +281,7 @@ class RoamCustomTrackingOptions {
allowBackgroundLocationUpdates: any,
pausesLocationUpdatesAutomatically: any,
showsBackgroundLocationIndicator: any,
accuracyFilter: any
accuracyFilter: any,
) {
this.desiredAccuracy = desiredAccuracy;
this.updateInterval = updateInterval;
Expand Down Expand Up @@ -360,12 +360,12 @@ function roamTripToMap(roamTrip: any) {
const createTrip = (
roamTrip: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.createTrip(
roamTripToMap(roamTrip),
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -374,14 +374,14 @@ const startQuickTrip = (
trackingMode: any,
customTrackingOption: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.startQuickTrip(
roamTripToMap(roamTrip),
trackingMode,
roamCustomTrackingOptionsToMap(customTrackingOption),
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -392,26 +392,26 @@ const startTrip = (tripId: any, successCallback: any, errorCallback: any) => {
const updateTrip = (
roamTrip: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.updateTrip(
roamTripToMap(roamTrip),
successCallback,
errorCallback
errorCallback,
);
};

const endTrip = (
tripId: any,
forceStopTracking: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.endTrip(
tripId,
forceStopTracking,
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -434,15 +434,15 @@ const getTrip = (tripId: any, successCallback: any, errorCallback: any) => {
const getActiveTrips = (
isLocal: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.getActiveTrips(isLocal, successCallback, errorCallback);
};

const getTripSummary = (
tripId: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.getTripSummary(tripId, successCallback, errorCallback);
};
Expand Down Expand Up @@ -480,30 +480,30 @@ type RNRoamType = {
const { RNRoam } = NativeModules as { RNRoam?: RNRoamType };

const batchProcess = (enable: boolean, syncHour: number): void => {
console.log('batchProcess called with:', { enable, syncHour });
console.log("batchProcess called with:", { enable, syncHour });

if (RNRoam?.batchProcess) {
try {
RNRoam.batchProcess(enable, syncHour);
console.log('batchProcess executed successfully.');
console.log("batchProcess executed successfully.");
} catch (error) {
console.error('Error executing batchProcess:', error);
console.error("Error executing batchProcess:", error);
}
} else {
console.warn('RNRoam module is not linked properly.');
console.warn("RNRoam module is not linked properly.");
}
};
export const createGeofence = (geofence: { [key: string]: any }) => {
if (NativeModules.RNRoam && NativeModules.RNRoam.createGeofence) {
NativeModules.RNRoam.createGeofence(geofence)
.then((response: any) => {
console.log('Geofence created:', response);
console.log("Geofence created:", response);
})
.catch((error: any) => {
console.error('Error creating geofence:', error);
console.error("Error creating geofence:", error);
});
} else {
console.error('createGeofence method is not available');
console.error("createGeofence method is not available");
}
};

Expand All @@ -519,7 +519,7 @@ const startTrackingCustom = (
showBackIndicator: any,
distanceFilter: any,
accuracyFilter: any,
updateInterval: any
updateInterval: any,
) => {
NativeModules.RNRoam.startTrackingCustom(
allowBackground,
Expand All @@ -529,7 +529,7 @@ const startTrackingCustom = (
showBackIndicator,
distanceFilter,
accuracyFilter,
updateInterval
updateInterval,
);
};

Expand All @@ -541,7 +541,7 @@ const startSelfTrackingCustom = (
showBackIndicator: any,
distanceFilter: any,
accuracyFilter: any,
updateInterval: any
updateInterval: any,
) => {
NativeModules.RNRoam.startSelfTrackingCustom(
allowBackground,
Expand All @@ -551,7 +551,7 @@ const startSelfTrackingCustom = (
showBackIndicator,
distanceFilter,
accuracyFilter,
updateInterval
updateInterval,
);
};

Expand All @@ -562,12 +562,12 @@ const startTrackingTimeInterval = (timeInterval: any, desiredAccuracy: any) => {
const startTrackingDistanceInterval = (
distance: any,
stationary: any,
desiredAccuracy: any
desiredAccuracy: any,
) => {
NativeModules.RNRoam.startTrackingDistanceInterval(
distance,
stationary,
desiredAccuracy
desiredAccuracy,
);
};

Expand All @@ -585,15 +585,15 @@ const setForegroundNotification = (
description: any,
image: any,
activity: any,
roamService: any
roamService: any,
) => {
NativeModules.RNRoam.setForegroundNotification(
enabled,
title,
description,
image,
activity,
roamService
roamService,
);
};

Expand All @@ -609,13 +609,13 @@ const getCurrentLocation = (
desiredAccuracy: any,
accuracy: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.getCurrentLocation(
desiredAccuracy,
accuracy,
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -626,12 +626,12 @@ const updateCurrentLocation = (desiredAccuracy: any, accuracy: any) => {
const getCurrentLocationIos = (
accuracy: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.getCurrentLocationIos(
accuracy,
successCallback,
errorCallback
errorCallback,
);
};

Expand Down Expand Up @@ -661,23 +661,23 @@ const startSelfTracking = (trackingMode: any) => {

const startSelfTrackingTimeInterval = (
timeInterval: any,
desiredAccuracy: any
desiredAccuracy: any,
) => {
NativeModules.RNRoam.startSelfTrackingTimeInterval(
timeInterval,
desiredAccuracy
desiredAccuracy,
);
};

const startSelfTrackingDistanceInterval = (
distance: any,
stationary: any,
desiredAccuracy: any
desiredAccuracy: any,
) => {
NativeModules.RNRoam.startSelfTrackingDistanceInterval(
distance,
stationary,
desiredAccuracy
desiredAccuracy,
);
};

Expand Down Expand Up @@ -713,14 +713,14 @@ const setBatchReceiverConfig = (
batchCount: any,
batchWindow: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.setBatchReceiverConfig(
networkState,
batchCount,
batchWindow,
successCallback,
errorCallback
errorCallback,
);
};

Expand All @@ -738,15 +738,15 @@ const setTrackingConfig = (
source: any,
discardLocation: any,
successCallback: any,
errorCallback: any
errorCallback: any,
) => {
NativeModules.RNRoam.setTrackingConfig(
accuracy,
timeout,
source,
discardLocation,
successCallback,
errorCallback
errorCallback,
);
};

Expand Down