spotny-sdk 0.3.3 → 0.3.4

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.
@@ -88,8 +88,14 @@ public class SpotnyBeaconScanner: NSObject {
88
88
 
89
89
  locationManager = CLLocationManager()
90
90
  locationManager.delegate = self
91
- locationManager.allowsBackgroundLocationUpdates = true
92
- locationManager.pausesLocationUpdatesAutomatically = false
91
+ // allowsBackgroundLocationUpdates = true requires the app to declare the
92
+ // "location" UIBackgroundModes entry. Setting it without that entitlement
93
+ // raises NSInternalInconsistencyException and terminates the app.
94
+ if let modes = Bundle.main.object(forInfoDictionaryKey: "UIBackgroundModes") as? [String],
95
+ modes.contains("location") {
96
+ locationManager.allowsBackgroundLocationUpdates = true
97
+ locationManager.pausesLocationUpdatesAutomatically = false
98
+ }
93
99
 
94
100
  beaconManager = KTKBeaconManager(delegate: self)
95
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spotny-sdk",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Beacon Scanner",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",