
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
rn-calmgeo
Advanced tools
A React Native Module wrapper for CalmGeo
| iOS | React Native |
|---|---|
| >=17.0 | >=0.73.9 |
npm
npm install rn-calmgeo
iOS
cd ios
pod install
RnCalmGeo
| API | function |
|---|---|
| start(config: Config): Promise | start service |
| config(config: Config): Promise | config & restart service |
| stop(): Promise | stop service |
| getCount(): Promise | get local record count |
| getLocation(): Promise | get current location (also save to local storage) |
| clear(): Promise | clear local storage |
| sync(): Promise | upload to server |
| registerListener(listener: Listener) | regist location listener, return a unsubscriber function object () => void |
| isRunning(): Promise | true if the service is running |
Config| field | type | description |
|---|---|---|
| desiredAccuracy | DesiredAccuracy | Desired Accuracy |
| distanceFilter | number | The minimum distance (measured in meters) a device must move horizontally before an update event is generated. |
| disableSpeedMultiplier | boolean | Set true to disable automatic speed-based distanceFilter elasticity. |
| speedMultiplier | number | Controls the scale of automatic speed-based distanceFilter elasticity. |
| stationaryRadius | number | When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage. |
| url? | string | Your server url where you wish to HTTP POST locations to |
| token? | string | Bearer token |
| httpTimeout | number | HTTP request timeout in milliseconds. |
| method | METHOD | The HTTP method. |
| autoSync | boolean | If you've enabled HTTP feature by configuring an url, the plugin will attempt to upload each location to your server as it is recorded. |
| syncThreshold | number | The minimum number of persisted records to trigger an sync action. |
| maxBatchSize | number | If you've enabled HTTP feature by configuring an url and autySync: true, this parameter will limit the number of records attached to each batch. |
| maxDaysToPersist | number | Maximum number of days to store a geolocation in local storage. |
| fetchActivity | boolean | Set true to fetch activity information. |
Location| field | type | description |
|---|---|---|
| id | string | UUID |
| timestamp | string | ISO-8601 UTC timestamp provided by the native location API. |
| isMoving | boolean | true if location was recorded while in the moving state. |
| coords | COORDS | location info |
| activity | Activity | activity info |
Coords| field | type | description |
|---|---|---|
| latitude | number | latitude |
| longitude | number | longitude |
| accuracy | number | accuracy (m) |
| altitude | number | altitude |
| altitudeAccuracy | number | Accuracy of altitude (m) |
| ellipsoidalAltitude | number | ellipsoidalAltitude |
| speed | number | speed (m/s) |
| speedAccuracy | number | Accuracy of speed (m/s) |
| heading | number | heading (north: 0.0) (deg) |
| headingAccuracy | number | Accuracy of heading (deg) |
| floor | number | floor |
| mock | boolean | true if the system generates the location using on-device software simulation. |
| external | boolean | true if the system receives the location from an external accessory. |
Listenerfunction (location: Location) void
DesiredAccuracyBEST_FOR_NAVIGATIONBESTTEN_METERSHUNDRED_METERSKILOMETERTHREE_KILOMETERSMethodActivity| field | type | description |
|---|---|---|
| type | enum | still | on_foot | walking | running | in_vehicle | on_bicycle | unknown |
| confidence | number | [0~100]% |
import {
Config,
desiredAccuracyEnum,
requestMethodEnum,
RnCalmGeo,
type Location,
} from 'rn-calmgeo';
// config
const configJson: Config = {
desiredAccuracy: desiredAccuracyEnum.enum.BEST_FOR_NAVIGATION,
distanceFilter: 16,
disableSpeedMultiplier: false,
speedMultiplier: 3.1,
stationaryRadius: 25.0,
httpTimeout: 10000,
method: requestMethodEnum.enum.POST,
autoSync: true,
syncThreshold: 12,
maxBatchSize: 250,
maxDaysToPersist: 7,
};
// App
export default function App() {
const [loca, setLoca] = useState<Location | undefined>();
useEffect(() => {
RnCalmGeo.start(configJson).then((value: boolean) => {
console.log('start', value);
});
const clean = RnCalmGeo.registerListener(location => {
setLoca(location);
console.log('getCount', value);
setCount(value);
});
});
return clean;
}, []);
return (
<SafeAreaView style={styles.container}>
<View style={styles.row}>
<Button title="Stop" onPress={() => RnCalmGeo.stop()} />
<Button title="Restart" onPress={() => RnCalmGeo.config(configJson)} />
<Button title="Location" onPress={() => RnCalmGeo.getLocation()} />
</View>
<Text>Location: {JSON.stringify(loca, null, 2)}</Text>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
marginHorizontal: 20,
flex: 1,
alignItems: 'flex-start',
justifyContent: 'flex-start',
gap: 10,
},
row: {
alignSelf: 'stretch',
gap: 10,
maxHeight: 40,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
},
button: {
backgroundColor: 'blue',
},
});

See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
A React Native Module wrapper for CalmGeo
We found that rn-calmgeo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.