Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@okhi/react-native-background-geofencing
Advanced tools
Readme
A reliable React Native geofencing library, that works in the background and survives device restarts.
WARNING: Currently only supports Android devices. Plans for iOS are underway
$ yarn add react-native-background-geofencing
$ react-native link react-native-background-geofencing
Add the following permissions to your AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
$ touch myTask.js
myTask.js
The task will be executed in the background even after the device restarts.
import {RNGeofenceEvent} from 'react-native-background-geofencing';
export default async function myTask({event, data}) {
// handle Geofence updates here
if (event === RNGeofenceEvent.ENTER) {
console.log(`welcome to ${data.lat},${data.lng}`);
}
if (event === RNGeofenceEvent.ERROR) {
console.log(`Opps, something went wrong: ${data.errorMessage}`);
}
}
Add the following in your app's index.js
file.
import {AppRegistry} from 'react-native';
import {
configureJSTask,
configureWebhook,
} from 'react-native-background-geofencing';
import App from './App';
import myTask from './myTask.js';
configureJSTask({
task: myTask,
// Required to enable your task to run as an Android foreground service
notification: {
title: "Don't mind me",
text: "I'm just a notification",
},
});
// If you'd like to ship the events to a server use this.
// Its guaranteed to run when the device has an internet connection using Android's Work manager API
configureWebhook({
url: 'https://myapi.com/geofences',
headers: {
foo: 'Bar',
},
});
AppRegistry.registerComponent(appName, () => App);
import RNBackgroundGeofencing from 'react-native-background-geofencing';
const geofence = {
id: 'mygeofence',
lat: -1.29273,
lng: 36.820389,
};
await RNBackgroundGeofencing.add(geofence);
await RNBackgroundGeofencing.remove(geofence.id);
Are welcomed ♥️ especially those specifically addressing iOS support and bug fixes.
FAQs
A reliable React Native Geofencing library, that works in the background and survives device restarts
The npm package @okhi/react-native-background-geofencing receives a total of 7 weekly downloads. As such, @okhi/react-native-background-geofencing popularity was classified as not popular.
We found that @okhi/react-native-background-geofencing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.