Skip to content

Commit

Permalink
Merge branch 'expo-polygon-license'
Browse files Browse the repository at this point in the history
  • Loading branch information
christocracy committed Jul 8, 2024
2 parents 458ce74 + ec20af1 commit 782802c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
9 changes: 8 additions & 1 deletion expo/plugin/src/androidPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {

type Props = {
license?: string,
hmsLicense?: string
hmsLicense?: string,
polygonLicense?: string
}

import path from 'path';
Expand All @@ -27,6 +28,7 @@ const PRIVATE_MODULE = PUBLIC_MODULE + '-android';

const META_LICENSE_KEY = "com.transistorsoft.locationmanager.license";
const META_HMS_LICENSE_KEY = "com.transistorsoft.locationmanager.hms.license";
const META_POLYGON_LICENSE_KEY = "com.transistorsoft.locationmanager.polygon.license";

const findModuleRecursively = (dir: string): string | null => {
const nodeModules = path.resolve(dir, 'node_modules');
Expand Down Expand Up @@ -96,6 +98,11 @@ const androidPlugin: ConfigPlugin<Props> = (config, props={}) => {
META_HMS_LICENSE_KEY,
props.hmsLicense || "UNDEFINED"
);
addMetaDataItemToMainApplication(
mainApplication,
META_POLYGON_LICENSE_KEY,
props.polygonLicense || "UNDEFINED"
);
return config;

});
Expand Down
9 changes: 7 additions & 2 deletions expo/plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ const withBackgroundGeolocation: ConfigPlugin<
/**
* Huawei HMS license Default ""
*/
hmsLicense?: string
hmsLicense?: string,
/**
* Polygon Geofencing License Default ""
*/
polygonLicense?: string
} | void
> = (config, _props) => {
const props = _props || {};

return withPlugins(config, [
[androidPlugin, {
license: props.license,
hmsLicense: props.hmsLicense
hmsLicense: props.hmsLicense,
polygonLicense: props.polygonLicense
}],
[iOSPlugin, {
// no props for ios currently.
Expand Down
22 changes: 22 additions & 0 deletions help/INSTALL-EXPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ npx expo install expo-gradle-ext-vars
}
```

### Polygon Geofencing Support

If you've purchased the [*Polygon Geofencing* add-on](https://shop.transistorsoft.com/collections/frontpage/products/polygon-geofencing) for creating geofences of *any shape*, add your *Polygon Geofencing* license key:

```diff
{
"expo": {
"name": "your-app-name",
"plugins": [
[
"react-native-background-geolocation", {
"license": "YOUR_LICENSE_KEY_HERE",
+ "polygonLicense": "YOUR_POLYGON_LICENSE_HERE"
}
]
]
}
}
```

:warning: Polygon Geofencing support for *Expo* requires `react-native-background-geolocation >= 4.16.4`.

### Huawei Mobile Services (HMS) Support

If you've [purchased an *HMS Background Geolocation* License](https://shop.transistorsoft.com/collections/frontpage/products/huawei-background-geolocation) for installing the plugin on _Huawei_ devices without *Google Play Services* installed, add your *HMS Background Geolocation* license key:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-background-geolocation",
"version": "4.16.3",
"version": "4.16.4",
"description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence",
"scripts": {
"build": "yarn run build:expo",
Expand Down

0 comments on commit 782802c

Please sign in to comment.