spotny-sdk 0.2.4 → 0.2.6

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.
@@ -109,8 +109,8 @@ public class SpotnyBeaconScanner: NSObject {
109
109
  public func startScanner(
110
110
  withUserUUID userUUID: String,
111
111
  userId: NSNumber?,
112
- resolve: @escaping RCTPromiseResolveBlock,
113
- reject: @escaping RCTPromiseRejectBlock
112
+ resolve: @escaping (Any?) -> Void,
113
+ reject: @escaping (String?, String?, Error?) -> Void
114
114
  ) {
115
115
  if scanning {
116
116
  resolve("Already scanning")
@@ -141,8 +141,8 @@ public class SpotnyBeaconScanner: NSObject {
141
141
 
142
142
  @objc
143
143
  public func stopScanner(
144
- withResolve resolve: @escaping RCTPromiseResolveBlock,
145
- reject: @escaping RCTPromiseRejectBlock
144
+ withResolve resolve: @escaping (Any?) -> Void,
145
+ reject: @escaping (String?, String?, Error?) -> Void
146
146
  ) {
147
147
  beaconManager.stopMonitoringForAllRegions()
148
148
  beaconManager.stopRangingBeaconsInAllRegions()
@@ -162,8 +162,8 @@ public class SpotnyBeaconScanner: NSObject {
162
162
 
163
163
  @objc
164
164
  public func isScanning(
165
- withResolve resolve: @escaping RCTPromiseResolveBlock,
166
- reject: @escaping RCTPromiseRejectBlock
165
+ withResolve resolve: @escaping (Any?) -> Void,
166
+ reject: @escaping (String?, String?, Error?) -> Void
167
167
  ) {
168
168
  resolve(scanning)
169
169
  }
@@ -171,8 +171,8 @@ public class SpotnyBeaconScanner: NSObject {
171
171
  @objc
172
172
  public func configure(
173
173
  with config: NSDictionary,
174
- resolve: @escaping RCTPromiseResolveBlock,
175
- reject: @escaping RCTPromiseRejectBlock
174
+ resolve: @escaping (Any?) -> Void,
175
+ reject: @escaping (String?, String?, Error?) -> Void
176
176
  ) {
177
177
  if let url = config["backendURL"] as? String {
178
178
  backendURL = url
@@ -192,8 +192,8 @@ public class SpotnyBeaconScanner: NSObject {
192
192
 
193
193
  @objc
194
194
  public func requestNotificationPermissions(
195
- withResolve resolve: @escaping RCTPromiseResolveBlock,
196
- reject: @escaping RCTPromiseRejectBlock
195
+ withResolve resolve: @escaping (Any?) -> Void,
196
+ reject: @escaping (String?, String?, Error?) -> Void
197
197
  ) {
198
198
  UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
199
199
  DispatchQueue.main.async {
@@ -209,8 +209,8 @@ public class SpotnyBeaconScanner: NSObject {
209
209
  @objc
210
210
  public func setDebounceInterval(
211
211
  _ interval: Double,
212
- resolve: @escaping RCTPromiseResolveBlock,
213
- reject: @escaping RCTPromiseRejectBlock
212
+ resolve: @escaping (Any?) -> Void,
213
+ reject: @escaping (String?, String?, Error?) -> Void
214
214
  ) {
215
215
  debounceInterval = interval
216
216
  resolve("Debounce interval set to \(interval)s")
@@ -218,8 +218,8 @@ public class SpotnyBeaconScanner: NSObject {
218
218
 
219
219
  @objc
220
220
  public func clearDebounceCache(
221
- withResolve resolve: @escaping RCTPromiseResolveBlock,
222
- reject: @escaping RCTPromiseRejectBlock
221
+ withResolve resolve: @escaping (Any?) -> Void,
222
+ reject: @escaping (String?, String?, Error?) -> Void
223
223
  ) {
224
224
  lastCampaignFetchAttempt.removeAll()
225
225
  fetchInProgress.removeAll()
@@ -228,8 +228,8 @@ public class SpotnyBeaconScanner: NSObject {
228
228
 
229
229
  @objc
230
230
  public func getDebounceStatus(
231
- withResolve resolve: @escaping RCTPromiseResolveBlock,
232
- reject: @escaping RCTPromiseRejectBlock
231
+ withResolve resolve: @escaping (Any?) -> Void,
232
+ reject: @escaping (String?, String?, Error?) -> Void
233
233
  ) {
234
234
  var status: [String: Any] = [:]
235
235
  for (key, _) in activeCampaigns {
@@ -255,8 +255,8 @@ public class SpotnyBeaconScanner: NSObject {
255
255
 
256
256
  @objc
257
257
  public func getDebugLogs(
258
- withResolve resolve: @escaping RCTPromiseResolveBlock,
259
- reject: @escaping RCTPromiseRejectBlock
258
+ withResolve resolve: @escaping (Any?) -> Void,
259
+ reject: @escaping (String?, String?, Error?) -> Void
260
260
  ) {
261
261
  guard let docsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
262
262
  reject("ERROR", "Cannot access documents directory", nil); return
@@ -267,8 +267,8 @@ public class SpotnyBeaconScanner: NSObject {
267
267
 
268
268
  @objc
269
269
  public func clearDebugLogs(
270
- withResolve resolve: @escaping RCTPromiseResolveBlock,
271
- reject: @escaping RCTPromiseRejectBlock
270
+ withResolve resolve: @escaping (Any?) -> Void,
271
+ reject: @escaping (String?, String?, Error?) -> Void
272
272
  ) {
273
273
  guard let docsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
274
274
  reject("ERROR", "Cannot access documents directory", nil); return
package/ios/SpotnySdk.mm CHANGED
@@ -1,4 +1,8 @@
1
1
  #import "SpotnySdk.h"
2
+ // Import frameworks needed by the auto-generated SpotnySdk-Swift.h
3
+ // (it exposes CLLocationManagerDelegate and KTKBeaconManagerDelegate conformances)
4
+ #import <CoreLocation/CoreLocation.h>
5
+ @import KontaktSDK;
2
6
  // Auto-generated Swift header (contains SpotnyBeaconScanner)
3
7
  #import "SpotnySdk-Swift.h"
4
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spotny-sdk",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Beacon Scanner",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",