@expofp/react-native-efp-crowdconnected 0.1.3 → 0.1.5

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.
@@ -78,12 +78,20 @@ data class ExpoFpPosition(
78
78
  lat = null,
79
79
  lng = null
80
80
  )
81
+ "GEO" -> ExpoFpPosition(
82
+ x = null,
83
+ y = null,
84
+ z = z,
85
+ angle = angle,
86
+ lat = latitude,
87
+ lng = longitude
88
+ )
81
89
  else -> {
82
- // GEO and unknown types: only lat/lng, no x/y
83
- // GEO location type uses lat/lng only
90
+ // Unknown or mixed types: include all available coordinates
91
+ // This ensures blue dot works even if locationType is unexpected
84
92
  ExpoFpPosition(
85
- x = null,
86
- y = null,
93
+ x = xPixels,
94
+ y = yPixels,
87
95
  z = z,
88
96
  angle = angle,
89
97
  lat = latitude,
@@ -407,8 +407,11 @@ class RCTCrowdConnectedLocationProviderModule(
407
407
  val statusCallback = object : StatusCallback {
408
408
  override fun onStartUpSuccess() {
409
409
  Log.d(TAG, "StatusCallback: SDK startup successful")
410
- // Cancel timeout on SDK startup success
411
410
  cancelTimeoutJob()
411
+ registerPositionCallback()
412
+ CrowdConnected.getInstance()?.getDeviceId()?.let {
413
+ providerInfo = providerInfo.copy(deviceId = it)
414
+ }
412
415
  }
413
416
 
414
417
  override fun onStartUpFailure(reason: String) {
@@ -466,20 +469,8 @@ class RCTCrowdConnectedLocationProviderModule(
466
469
  CrowdConnected.start(app, config)
467
470
 
468
471
  Log.i(TAG, "CrowdConnected SDK start initiated")
469
-
470
- // Get device ID from CrowdConnected instance
471
- val deviceId = CrowdConnected.getInstance()?.getDeviceId()
472
- if (deviceId != null) {
473
- providerInfo = providerInfo.copy(deviceId = deviceId)
474
- Log.d(TAG, "Device ID set: $deviceId")
475
- }
476
-
477
- // Mark as started (SDK successfully started)
478
472
  isStarted = true
479
473
 
480
- // Register position callback
481
- registerPositionCallback()
482
-
483
474
  // Apply aliases
484
475
  if (currentSettings.aliases.isNotEmpty()) {
485
476
  Log.d(TAG, "Applying ${currentSettings.aliases.size} aliases")
@@ -16,11 +16,14 @@ import React
16
16
  import UIKit
17
17
 
18
18
  // See example https://github.com/nathvarun/react-native-native-module-swift-tutorial/blob/master/ios/Counter.swift
19
+ @MainActor
19
20
  @objc(RCTCrowdConnectedLocationProvider)
20
21
  class RCTCrowdConnectedLocationProvider: RCTEventEmitter, CLLocationManagerDelegate, CrowdConnectedDelegate {
21
22
 
22
23
  // MARK: - Properties
23
24
 
25
+ override var methodQueue: DispatchQueue! { .main }
26
+
24
27
  private let locationEventName = "onLocationChange"
25
28
  private let locationErrorName = "onLocationError"
26
29
 
@@ -43,6 +46,8 @@ class RCTCrowdConnectedLocationProvider: RCTEventEmitter, CLLocationManagerDeleg
43
46
  [locationEventName, locationErrorName]
44
47
  }
45
48
 
49
+ @objc override static func requiresMainQueueSetup() -> Bool { true }
50
+
46
51
  @objc func setup(
47
52
  _ settings: NSDictionary,
48
53
  resolver resolve: @escaping RCTPromiseResolveBlock,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/react-native-efp-crowdconnected",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "React Native wrapper for ExpoFP around CrowdConnected SDK",
5
5
  "keywords": [
6
6
  "react-native",