Skip to content

Commit

Permalink
Release 4.0.1 with latest Expo and HT SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
ferologics committed Nov 10, 2023
1 parent 6a20f97 commit ce49b0a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.1] - 2023-11-11

### Fixed

- Deleted leftover config plugin properties which were removed in new SDK version

## [4.0.0] - 2023-10-03

### Changed
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Add `hypertrack-sdk-expo` to [`plugins`](https://docs.expo.io/versions/latest/co
{
"publishableKey": "YourPublishableKey", // find this in the HyperTrack dashboard
"locationPermission": "We need your location to track delivered orders."
},
],
}
]
]
}
}
Expand Down Expand Up @@ -73,16 +73,17 @@ For `Bare workflow projects, you can follow the [manual setup guide for React Na

## Versioning

Ensure you use versions that work together!
Ensure you use versions that work together! These are the ones that have been tested by us at the time of release:

| `expo` | `hypertrack-sdk-expo` | `hypertrack-sdk-react-native` |
| -------- | --------------------- | ----------------------------- |
| ^45.0.0 | 1.0.0 | ^7.19.1 |
| ^46.0.14 | 1.1.0 | ^8.2.1 |
| ^46.0.14 | 1.2.0 | ^8.2.1 |
| ^47.0.0 | 2.0.0 | ^9.0.0 |
| ^48.0.0 | 3.0.0 | ^9.0.0 |
| ^49.0.13 | 4.0.1 | ^11.0.9 |
| ^49.0.0 | 4.0.0 | ^11.0.2 |
| ^48.0.0 | 3.0.0 | ^9.0.0 |
| ^47.0.0 | 2.0.0 | ^9.0.0 |
| ^46.0.14 | 1.2.0 | ^8.2.1 |
| ^46.0.14 | 1.1.0 | ^8.2.1 |
| ^45.0.0 | 1.0.0 | ^7.19.1 |

## Configuring permission purpose strings

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": "hypertrack-sdk-expo",
"version": "4.0.0",
"version": "4.0.1",
"license": "MIT",
"description": "Config plugin to auto configure hypertrack-sdk-react-native on prebuild",
"homepage": "https://github.com/hypertrack/sdk-expo",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { withHyperTrackIOS } from "./withHyperTrackIOS";

export type Props = {
locationPermission?: string;
motionPermission?: string;
publishableKey?: string;
};
const withHyperTrack: ConfigPlugin<Props> = (config, props) => {
Expand All @@ -19,5 +20,5 @@ const withHyperTrack: ConfigPlugin<Props> = (config, props) => {
export default createRunOncePlugin(
withHyperTrack,
"hypertrack-sdk-expo",
"4.0.0"
"4.0.1"
);
17 changes: 5 additions & 12 deletions src/withHyperTrackIOS.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { ConfigPlugin, withInfoPlist } from "@expo/config-plugins";
import { Props } from ".";

const LOCATION_PERMISSION_HINT =
"You need this permission to allow HyperTrack to track your location";

const NSLocationAlwaysAndWhenInUseUsageDescription = LOCATION_PERMISSION_HINT;
const NSLocationAlwaysUsageDescription = LOCATION_PERMISSION_HINT;
const NSLocationWhenInUseUsageDescription = LOCATION_PERMISSION_HINT;

export const withHyperTrackIOS: ConfigPlugin<Props> = (config, props) => {
withBackgroundModes(config, props);
return config;
Expand All @@ -16,6 +9,7 @@ export const withHyperTrackIOS: ConfigPlugin<Props> = (config, props) => {
const withBackgroundModes: ConfigPlugin<Props> = (config, props) => {
const {
locationPermission: locationPermissionDescription,
motionPermission: motionPermissionDescription,
publishableKey,
} = props || {};

Expand All @@ -37,13 +31,12 @@ const withBackgroundModes: ConfigPlugin<Props> = (config, props) => {

// Set permission descriptions
newConfig.modResults.NSLocationAlwaysAndWhenInUseUsageDescription =
locationPermissionDescription ??
NSLocationAlwaysAndWhenInUseUsageDescription;
locationPermissionDescription;
newConfig.modResults.NSLocationAlwaysUsageDescription =
locationPermissionDescription ?? NSLocationAlwaysUsageDescription;
locationPermissionDescription;
newConfig.modResults.NSLocationWhenInUseUsageDescription =
locationPermissionDescription ?? NSLocationWhenInUseUsageDescription;

locationPermissionDescription;
newConfig.modResults.NSMotionUsageDescription = motionPermissionDescription;
// Set SDK init params
newConfig.modResults.HyperTrackPublishableKey =
publishableKey ?? "INVALID_PUBLISHABLE_KEY"; // TODO: should we crash here?
Expand Down

0 comments on commit ce49b0a

Please sign in to comment.