@expofp/react-native-efp-crowdconnected 0.1.6 → 0.1.8

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.
package/README.md CHANGED
@@ -18,10 +18,8 @@ React Native Turbo Module for CrowdConnected location tracking and indoor positi
18
18
 
19
19
  ## Requirements
20
20
 
21
- - React Native 0.71+
22
- - React 18+
23
- - iOS 12.0+ (CrowdConnected SDK v2.2.1)
24
- - Android 7+ (API 24+)
21
+ - Android 7.0+ (API level 24+)
22
+ - iOS minimum version follows your React Native installation
25
23
 
26
24
  ## Installation
27
25
 
@@ -37,9 +35,21 @@ yarn add @expofp/react-native-efp-crowdconnected
37
35
  cd ios && pod install
38
36
  ```
39
37
 
38
+ Your host app's `Info.plist` must declare the relevant location/Bluetooth usage descriptions and `UIBackgroundModes` entries. See [`example/ios/ExpofpCrowdconnectedExample/Info.plist`](./example/ios/ExpofpCrowdconnectedExample/Info.plist) for a working configuration.
39
+
40
40
  ### Android
41
41
 
42
- No additional setup required. CocoaPods/Gradle will handle dependencies.
42
+ Gradle resolves the dependencies automatically. The CrowdConnected SDK AARs (`net.crowdconnected.android.{core,background,geo,ips}`, fetched from CrowdConnected's Maven repository) contribute the foreground-service declaration and the following permissions via Gradle's manifest merger. You do not need to declare them in your host app's `AndroidManifest.xml`: `INTERNET`, `ACCESS_FINE_LOCATION`, `ACCESS_COARSE_LOCATION`, `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_LOCATION`, `BLUETOOTH_SCAN`, `BLUETOOTH_CONNECT`, and the legacy `BLUETOOTH` / `BLUETOOTH_ADMIN` (`maxSdkVersion=30`).
43
+
44
+ If you set `isBackgroundUpdateEnabled: true`, your host app **must** also declare:
45
+
46
+ ```xml
47
+ <!-- AndroidManifest.xml -->
48
+ <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
49
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
50
+ ```
51
+
52
+ `ACCESS_BACKGROUND_LOCATION` cannot be granted from the standard runtime prompt on Android 11+; the system redirects the user to the app's settings screen, where they must select "Allow all the time".
43
53
 
44
54
  ## Quick Start
45
55
 
@@ -84,7 +94,7 @@ unsubscribeError();
84
94
 
85
95
  ## API Reference
86
96
 
87
- ### `setup(settings: ExpoFpLocationSettings): Promise<string>`
97
+ ### `setup(settings: ExpoFpLocationSettings): Promise<ExpoFpProviderInfo>`
88
98
 
89
99
  Initializes the CrowdConnected SDK with configuration.
90
100
 
@@ -98,25 +108,25 @@ Initializes the CrowdConnected SDK with configuration.
98
108
  - `isHeadingEnabled` - Enable compass/heading tracking
99
109
  - `aliases?` - Custom location aliases (optional)
100
110
 
101
- **Returns:** Promise resolving to initialization status
111
+ **Returns:** Promise resolving to `ExpoFpProviderInfo` (`{ deviceId?, isLocationUpdating }`)
102
112
 
103
113
  ---
104
114
 
105
- ### `startUpdatingLocation(): void`
115
+ ### `startUpdatingLocation(): Promise<ExpoFpProviderInfo>`
106
116
 
107
117
  Starts location tracking.
108
118
 
109
119
  ---
110
120
 
111
- ### `stopUpdatingLocation(): void`
121
+ ### `stopUpdatingLocation(): Promise<ExpoFpProviderInfo>`
112
122
 
113
123
  Stops location tracking.
114
124
 
115
125
  ---
116
126
 
117
- ### `isLocationUpdating(): Promise<boolean>`
127
+ ### `isLocationUpdating(): Promise<ExpoFpProviderInfo>`
118
128
 
119
- Checks if location tracking is currently active.
129
+ Returns the current provider state.
120
130
 
121
131
  ---
122
132
 
@@ -165,5 +175,5 @@ yarn prepare
165
175
  ## Support
166
176
 
167
177
  - 📖 [Documentation](https://developer.expofp.com)
168
- - 🐛 [Report Issues](https://github.com/expofp/react-native-crowdconnected/issues)
169
- - 💬 [Discussions](https://github.com/expofp/react-native-crowdconnected/discussions)
178
+ - 🐛 [Report Issues](https://github.com/expofp/react-native-efp-crowdconnected/issues)
179
+ - 💬 [Discussions](https://github.com/expofp/react-native-efp-crowdconnected/discussions)
@@ -32,6 +32,7 @@ import net.crowdconnected.android.core.Configuration
32
32
  import net.crowdconnected.android.core.CrowdConnected
33
33
  import net.crowdconnected.android.core.ErrorCode
34
34
  import net.crowdconnected.android.core.Location
35
+ import net.crowdconnected.android.background.BackgroundModule
35
36
  import net.crowdconnected.android.geo.GeoModule
36
37
  import net.crowdconnected.android.ips.IPSModule
37
38
 
@@ -484,8 +485,10 @@ class RCTCrowdConnectedLocationProviderModule(
484
485
  }
485
486
  }
486
487
 
487
- // Set foreground service notification if background updates are enabled
488
+ // BackgroundModule is required. Without it v3 silently stays in FOREGROUND mode
489
+ // and withForegroundServiceConfig is ignored.
488
490
  if (currentSettings.isBackgroundUpdateEnabled) {
491
+ builder.addModule(BackgroundModule())
489
492
  builder.withForegroundServiceConfig(
490
493
  NOTIFICATION_TITLE,
491
494
  NOTIFICATION_ICON
@@ -65,8 +65,6 @@ class RCTCrowdConnectedLocationProvider: RCTEventEmitter, @MainActor CLLocationM
65
65
  ccLocationManager.delegate = self
66
66
  clLocationManager.delegate = self
67
67
 
68
- settings.aliases.forEach(ccLocationManager.setAlias)
69
-
70
68
  isLocationUpdating
71
69
  ? startUpdatingLocation(resolve, rejecter: reject)
72
70
  : (try? providerInfo.toDict()).map(resolve)
@@ -192,6 +190,8 @@ extension RCTCrowdConnectedLocationProvider: @MainActor CrowdConnectedDelegate {
192
190
  clLocationManager.startUpdatingHeading()
193
191
  }
194
192
 
193
+ settings.aliases.forEach(ccLocationManager.setAlias)
194
+
195
195
  (try? providerInfo.toDict()).map { updatingResolver?($0) }
196
196
  updatingResolver = nil
197
197
  updatingRejecter = nil
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/react-native-efp-crowdconnected",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "React Native wrapper for ExpoFP around CrowdConnected SDK",
5
5
  "keywords": [
6
6
  "react-native",