react-native-background-live-tracking 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +19 -2
package/README.md CHANGED
@@ -56,6 +56,17 @@ If the package lives outside your app root, add its folder to `watchFolders` in
56
56
 
57
57
  Android is configured via `react-native.config.js` (`TrackingPackage`). Rebuild the native app after install.
58
58
 
59
+ ## Use in your app (any developer)
60
+
61
+ Import from **your** app code—not from inside this library. Use any screen or module that should start/stop tracking (for example `App.tsx`, `src/screens/DriverScreen.tsx`, or `src/services/liveTracking.ts`).
62
+
63
+ ```ts
64
+ import { Tracking } from 'react-native-background-live-tracking';
65
+ ```
66
+
67
+ - **`serverUrl`**, **`restHeaders`** (e.g. auth tokens), and **`driverId`** come from **your** backend and app state.
68
+ - **`googleStaticMapsApiKey`** (optional map preview) is **never** built into the npm package. Each app uses its **own** [Google Cloud](https://developers.google.com/maps/documentation/maps-static/overview) project and key; pass it only in `Tracking.start` or load it from env / secure config in **your** repo.
69
+
59
70
  ## Permissions
60
71
 
61
72
  The library declares the required permissions. Your app must **request** at runtime (in order on Android 10+):
@@ -148,6 +159,17 @@ When `socketTransport` is `socket.io` (or the URL suggests it), the client conne
148
159
 
149
160
  This repository’s root React Native app depends on the package via `file:./packages/react-native-background-live-tracking` and includes a minimal driver-style UI in `App.tsx`.
150
161
 
162
+ ## Changelog
163
+
164
+ ### 1.0.1
165
+
166
+ - Richer `package.json` (`exports`, `react-native` entry, `repository` / `bugs` placeholders—replace `your-username` with your GitHub).
167
+ - README: where to import the API and that map/server URLs are per-app, not fixed in the package.
168
+
169
+ ### 1.0.0
170
+
171
+ - Initial release: Android foreground tracking, REST / WebSocket / Socket.IO, queue, optional Static Maps notification preview.
172
+
151
173
  ## License
152
174
 
153
175
  MIT
package/package.json CHANGED
@@ -1,12 +1,22 @@
1
1
  {
2
2
  "name": "react-native-background-live-tracking",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Production-ready Android background GPS tracking with REST/WebSocket, offline queue, and foreground service.",
5
5
  "main": "src/index.ts",
6
+ "module": "src/index.ts",
6
7
  "types": "src/index.ts",
8
+ "react-native": "src/index.ts",
9
+ "sideEffects": false,
7
10
  "license": "MIT",
8
11
  "author": "",
9
- "homepage": "https://github.com/your-org/react-native-background-live-tracking#readme",
12
+ "homepage": "https://www.npmjs.com/package/react-native-background-live-tracking",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Rahul6694/react-native-background-live-tracking.git"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/Rahul6694/react-native-background-live-tracking/issues"
19
+ },
10
20
  "keywords": [
11
21
  "react-native",
12
22
  "background",
@@ -23,6 +33,13 @@
23
33
  "README.md",
24
34
  "react-native.config.js"
25
35
  ],
36
+ "exports": {
37
+ ".": {
38
+ "types": "./src/index.ts",
39
+ "react-native": "./src/index.ts",
40
+ "default": "./src/index.ts"
41
+ }
42
+ },
26
43
  "peerDependencies": {
27
44
  "react": ">=18.0.0",
28
45
  "react-native": ">=0.73.0"