@wayq/beekon-rn 0.1.0 → 0.1.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 (44) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +28 -2
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/AndroidManifest.xml +10 -0
  5. package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +105 -1
  6. package/ios/BeekonRn.swift +60 -10
  7. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
  8. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +5472 -2309
  9. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  10. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +87 -3
  11. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  12. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +5472 -2309
  13. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  14. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +87 -3
  15. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +5472 -2309
  16. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  17. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +87 -3
  18. package/lib/module/NativeBeekonRn.js +8 -0
  19. package/lib/module/NativeBeekonRn.js.map +1 -1
  20. package/lib/module/beekon.js +14 -1
  21. package/lib/module/beekon.js.map +1 -1
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/internal/mappers.js +83 -2
  24. package/lib/module/internal/mappers.js.map +1 -1
  25. package/lib/typescript/src/NativeBeekonRn.d.ts +20 -0
  26. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
  27. package/lib/typescript/src/beekon.d.ts +11 -1
  28. package/lib/typescript/src/beekon.d.ts.map +1 -1
  29. package/lib/typescript/src/index.d.ts +2 -2
  30. package/lib/typescript/src/index.d.ts.map +1 -1
  31. package/lib/typescript/src/internal/mappers.d.ts +3 -2
  32. package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
  33. package/lib/typescript/src/types/geofence.d.ts +37 -0
  34. package/lib/typescript/src/types/geofence.d.ts.map +1 -1
  35. package/lib/typescript/src/types/permission.d.ts +36 -0
  36. package/lib/typescript/src/types/permission.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/scripts/fetch-beekonkit.sh +4 -4
  39. package/src/NativeBeekonRn.ts +24 -0
  40. package/src/beekon.ts +20 -1
  41. package/src/index.tsx +7 -0
  42. package/src/internal/mappers.ts +114 -0
  43. package/src/types/geofence.ts +41 -0
  44. package/src/types/permission.ts +43 -0
@@ -6,7 +6,6 @@
6
6
  import Compression
7
7
  @preconcurrency import CoreLocation
8
8
  import CoreMotion
9
- import CryptoKit
10
9
  import Darwin
11
10
  import Foundation
12
11
  import Foundation/*.Bundle*/
@@ -16,6 +15,7 @@ import Network
16
15
  import Security
17
16
  import Swift
18
17
  @preconcurrency import UIKit
18
+ @preconcurrency import UserNotifications
19
19
  import _Concurrency
20
20
  import _StringProcessing
21
21
  import _SwiftConcurrencyShims
@@ -96,9 +96,17 @@ public struct AuthTokens : Swift.Sendable, Swift.Equatable {
96
96
  public init(accessToken: Swift.String, refreshToken: Swift.String?, expiresAt: Foundation.TimeInterval?, epoch: Swift.Int)
97
97
  public static func == (a: BeekonKit.AuthTokens, b: BeekonKit.AuthTokens) -> Swift.Bool
98
98
  }
99
+ @_inheritsConvenienceInitializers @objc(BeekonLaunchBridge) final public class BeekonLaunchBridge : ObjectiveC.NSObject {
100
+ @objc public static func launch()
101
+ @objc override dynamic public init()
102
+ @objc deinit
103
+ }
99
104
  @_hasMissingDesignatedInitializers public actor Beekon {
100
105
  public static let shared: BeekonKit.Beekon
101
106
  nonisolated public static func registerBackgroundTasks()
107
+ nonisolated public static func bootstrap()
108
+ @discardableResult
109
+ nonisolated public static func requestNotificationAuthorization() async -> Swift.Bool
102
110
  nonisolated public static func setWrapperInfo(product: Swift.String, version: Swift.String)
103
111
  public var licenseStatus: BeekonKit.LicenseStatus {
104
112
  get
@@ -113,6 +121,7 @@ public struct AuthTokens : Swift.Sendable, Swift.Equatable {
113
121
  public func getLocations(from: Foundation.Date, to: Foundation.Date) async throws -> [BeekonKit.Location]
114
122
  public func getCurrentLocation(timeout: Foundation.TimeInterval = 15, accuracy: BeekonKit.AccuracyMode? = nil) async throws -> BeekonKit.Location?
115
123
  nonisolated public func getPermissionStatus() -> BeekonKit.PermissionStatus
124
+ public func getRequiredPermissions() -> [BeekonKit.PermissionRequirement]
116
125
  public func deleteLocations(before: Foundation.Date?) async throws -> Swift.Int
117
126
  public func pendingUploadCount() async throws -> Swift.Int
118
127
  nonisolated public func setLogLevel(_ level: BeekonKit.LogLevel)
@@ -196,10 +205,11 @@ public struct BeekonGeofence : Swift.Sendable, Swift.Equatable, Swift.Codable {
196
205
  public var radiusMeters: Swift.Double
197
206
  public var notifyOnEntry: Swift.Bool
198
207
  public var notifyOnExit: Swift.Bool
199
- public init(id: Swift.String, latitude: Swift.Double, longitude: Swift.Double, radiusMeters: Swift.Double, notifyOnEntry: Swift.Bool = true, notifyOnExit: Swift.Bool = true)
208
+ public var notification: BeekonKit.GeofenceNotification?
209
+ public init(id: Swift.String, latitude: Swift.Double, longitude: Swift.Double, radiusMeters: Swift.Double, notifyOnEntry: Swift.Bool = true, notifyOnExit: Swift.Bool = true, notification: BeekonKit.GeofenceNotification? = nil)
210
+ public init(from decoder: any Swift.Decoder) throws
200
211
  public static func == (a: BeekonKit.BeekonGeofence, b: BeekonKit.BeekonGeofence) -> Swift.Bool
201
212
  public func encode(to encoder: any Swift.Encoder) throws
202
- public init(from decoder: any Swift.Decoder) throws
203
213
  }
204
214
  public enum BeekonState : Swift.Sendable, Swift.Equatable {
205
215
  case idle
@@ -228,6 +238,44 @@ public struct GeofenceEvent : Swift.Sendable, Swift.Equatable {
228
238
  public init(id: Swift.String, geofenceId: Swift.String, type: BeekonKit.Transition, timestamp: Foundation.Date)
229
239
  public static func == (a: BeekonKit.GeofenceEvent, b: BeekonKit.GeofenceEvent) -> Swift.Bool
230
240
  }
241
+ public enum NotificationDelivery : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
242
+ case local
243
+ case cloud
244
+ public init?(rawValue: Swift.String)
245
+ public typealias RawValue = Swift.String
246
+ public var rawValue: Swift.String {
247
+ get
248
+ }
249
+ }
250
+ public enum NotificationImportance : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
251
+ case `default`
252
+ case high
253
+ public init?(rawValue: Swift.String)
254
+ public typealias RawValue = Swift.String
255
+ public var rawValue: Swift.String {
256
+ get
257
+ }
258
+ }
259
+ public struct NotificationContent : Swift.Sendable, Swift.Equatable, Swift.Codable {
260
+ public var title: Swift.String
261
+ public var body: Swift.String
262
+ public var importance: BeekonKit.NotificationImportance
263
+ public var deepLink: Swift.String?
264
+ public var data: [Swift.String : Swift.String]
265
+ public init(title: Swift.String, body: Swift.String, importance: BeekonKit.NotificationImportance = .high, deepLink: Swift.String? = nil, data: [Swift.String : Swift.String] = [:])
266
+ public init(from decoder: any Swift.Decoder) throws
267
+ public func encode(to encoder: any Swift.Encoder) throws
268
+ public static func == (a: BeekonKit.NotificationContent, b: BeekonKit.NotificationContent) -> Swift.Bool
269
+ }
270
+ public struct GeofenceNotification : Swift.Sendable, Swift.Equatable, Swift.Codable {
271
+ public var onEnter: BeekonKit.NotificationContent?
272
+ public var onExit: BeekonKit.NotificationContent?
273
+ public var delivery: BeekonKit.NotificationDelivery
274
+ public init(onEnter: BeekonKit.NotificationContent? = nil, onExit: BeekonKit.NotificationContent? = nil, delivery: BeekonKit.NotificationDelivery = .local)
275
+ public init(from decoder: any Swift.Decoder) throws
276
+ public static func == (a: BeekonKit.GeofenceNotification, b: BeekonKit.GeofenceNotification) -> Swift.Bool
277
+ public func encode(to encoder: any Swift.Encoder) throws
278
+ }
231
279
  public enum LicenseStatus : Swift.Sendable, Swift.Equatable {
232
280
  case notDetermined
233
281
  case licensed(tier: Swift.String, entitlements: [Swift.String])
@@ -330,6 +378,36 @@ public enum MotionState : Swift.String, Swift.Sendable, Swift.Equatable, Swift.H
330
378
  get
331
379
  }
332
380
  }
381
+ public struct PermissionRequirement : Swift.Sendable, Swift.Equatable, Swift.Codable {
382
+ public enum Permission : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
383
+ case location
384
+ case backgroundLocation
385
+ case activityRecognition
386
+ case notifications
387
+ public init?(rawValue: Swift.String)
388
+ public typealias RawValue = Swift.String
389
+ public var rawValue: Swift.String {
390
+ get
391
+ }
392
+ }
393
+ public enum Importance : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
394
+ case required
395
+ case recommended
396
+ public init?(rawValue: Swift.String)
397
+ public typealias RawValue = Swift.String
398
+ public var rawValue: Swift.String {
399
+ get
400
+ }
401
+ }
402
+ public let permission: BeekonKit.PermissionRequirement.Permission
403
+ public let importance: BeekonKit.PermissionRequirement.Importance
404
+ public let satisfied: Swift.Bool
405
+ public let rationale: Swift.String
406
+ public init(permission: BeekonKit.PermissionRequirement.Permission, importance: BeekonKit.PermissionRequirement.Importance, satisfied: Swift.Bool, rationale: Swift.String)
407
+ public static func == (a: BeekonKit.PermissionRequirement, b: BeekonKit.PermissionRequirement) -> Swift.Bool
408
+ public func encode(to encoder: any Swift.Encoder) throws
409
+ public init(from decoder: any Swift.Decoder) throws
410
+ }
333
411
  public struct PermissionStatus : Swift.Sendable, Swift.Equatable, Swift.Codable {
334
412
  public enum Level : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
335
413
  case notDetermined
@@ -407,6 +485,10 @@ extension BeekonKit.AuthBodyFormat : Swift.Hashable {}
407
485
  extension BeekonKit.AuthBodyFormat : Swift.RawRepresentable {}
408
486
  extension BeekonKit.LocationUnavailableReason : Swift.Hashable {}
409
487
  extension BeekonKit.StopReason : Swift.RawRepresentable {}
488
+ extension BeekonKit.NotificationDelivery : Swift.Hashable {}
489
+ extension BeekonKit.NotificationDelivery : Swift.RawRepresentable {}
490
+ extension BeekonKit.NotificationImportance : Swift.Hashable {}
491
+ extension BeekonKit.NotificationImportance : Swift.RawRepresentable {}
410
492
  extension BeekonKit.LicenseInvalidReason : Swift.Hashable {}
411
493
  extension BeekonKit.LicenseInvalidReason : Swift.RawRepresentable {}
412
494
  extension BeekonKit.LocationQuality : Swift.RawRepresentable {}
@@ -414,6 +496,8 @@ extension BeekonKit.LocationTrigger : Swift.RawRepresentable {}
414
496
  extension BeekonKit.LogLevel : Swift.Hashable {}
415
497
  extension BeekonKit.LogLevel : Swift.RawRepresentable {}
416
498
  extension BeekonKit.MotionState : Swift.RawRepresentable {}
499
+ extension BeekonKit.PermissionRequirement.Permission : Swift.RawRepresentable {}
500
+ extension BeekonKit.PermissionRequirement.Importance : Swift.RawRepresentable {}
417
501
  extension BeekonKit.PermissionStatus.Level : Swift.RawRepresentable {}
418
502
  extension BeekonKit.PermissionStatus.Accuracy : Swift.RawRepresentable {}
419
503
  extension BeekonKit.StationaryMode : Swift.RawRepresentable {}