spotny-sdk 1.0.0
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/LICENSE +20 -0
- package/README.md +589 -0
- package/SpotnySdk.podspec +35 -0
- package/android/build.gradle +70 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/spotnysdk/SpotnySdkModule.kt +685 -0
- package/android/src/main/java/com/spotnysdk/SpotnySdkPackage.kt +31 -0
- package/ios/Frameworks/CBORCoding.xcframework/Info.plist +44 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/CBORCoding +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Headers/CBORCoding-Swift.h +317 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Info.plist +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios.abi.json +7021 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios.private.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64/CBORCoding.framework/Modules/module.modulemap +4 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/CBORCoding +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Headers/CBORCoding-Swift.h +630 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Info.plist +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios-simulator.abi.json +7021 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/arm64-apple-ios-simulator.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/x86_64-apple-ios-simulator.abi.json +7021 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/CBORCoding.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +193 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/Modules/module.modulemap +4 -0
- package/ios/Frameworks/CBORCoding.xcframework/ios-arm64_x86_64-simulator/CBORCoding.framework/_CodeSignature/CodeResources +267 -0
- package/ios/Frameworks/Half.xcframework/Info.plist +44 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Half +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Headers/Half-Swift.h +317 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Headers/half.h +95 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Info.plist +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios.abi.json +4942 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios.private.swiftinterface +650 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios.swiftinterface +650 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64/Half.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Half +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Headers/Half-Swift.h +630 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Headers/half.h +95 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Info.plist +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios-simulator.abi.json +4942 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +650 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/arm64-apple-ios-simulator.swiftinterface +650 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/x86_64-apple-ios-simulator.abi.json +4973 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +660 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/Half.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +660 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/Half.xcframework/ios-arm64_x86_64-simulator/Half.framework/_CodeSignature/CodeResources +245 -0
- package/ios/Frameworks/KontaktSDK.xcframework/Info.plist +44 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Base.lproj/Localizable.strings +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h +37 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKAction.h +90 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKActionContent.h +80 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKBeaconManager.h +326 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKBeaconRegion.h +102 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudClient.h +241 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudClientJSONResponseSerializer.h +20 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudClientResponseSerializer.h +35 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudClientSessionManager.h +207 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudDefinitions.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKCloudModel.h +36 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDevice.h +179 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceCCOperationDelegate.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h +329 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h +24 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceConnection.h +379 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceConnectionOperation.h +65 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceDataLoggerConnection.h +56 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h +49 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h +853 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGATTDefinitions.h +106 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGATTOperation.h +68 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGatewayConfigurationType.h +43 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h +101 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGatewayDiagnostic.h +61 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h +76 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceKontaktRecognitionBox.h +26 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceListenOperation.h +20 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceNotifyOperation.h +34 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h +86 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDeviceWriteOperation.h +51 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKDevicesManager.h +182 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystone.h +101 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneFrame.h +47 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneManager.h +160 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneRegion.h +85 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneTLM.h +49 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneUID.h +55 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneURL.h +33 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKEddystoneURLValueTransformer.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKFirmware.h +98 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKGroupOperation.h +100 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKKontaktResponse.h +85 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKManager.h +121 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKNearbyDevice.h +135 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h +513 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKOperation.h +116 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKPersonPosition.h +22 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h +86 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h +59 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKTrigger.h +94 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKTriggerContext.h +79 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KTKVenue.h +105 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/Kontakt.h +187 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KontaktSDK-Swift.h +668 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/KontaktSDK.h +43 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/NSData+Kontakt.h +115 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/NSError+Kontakt.h +26 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/NSString+Kontakt.h +25 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Headers/NSURLRequest+Kontakt.h +44 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Info.plist +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/KontaktSDK +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios.abi.json +14106 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64/KontaktSDK.framework/strip-frameworks.sh +72 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Base.lproj/Localizable.strings +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h +37 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKAction.h +90 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKActionContent.h +80 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKBeaconManager.h +326 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKBeaconRegion.h +102 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudClient.h +241 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudClientJSONResponseSerializer.h +20 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudClientResponseSerializer.h +35 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudClientSessionManager.h +207 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudDefinitions.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKCloudModel.h +36 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDevice.h +179 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceCCOperationDelegate.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h +329 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h +24 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceConnection.h +379 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceConnectionOperation.h +65 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceDataLoggerConnection.h +56 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h +49 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h +853 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGATTDefinitions.h +106 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGATTOperation.h +68 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGatewayConfigurationType.h +43 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h +101 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGatewayDiagnostic.h +61 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h +76 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceKontaktRecognitionBox.h +26 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceListenOperation.h +20 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceNotifyOperation.h +34 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h +86 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDeviceWriteOperation.h +51 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKDevicesManager.h +182 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystone.h +101 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneFrame.h +47 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneManager.h +160 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneRegion.h +85 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneTLM.h +49 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneUID.h +55 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneURL.h +33 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKEddystoneURLValueTransformer.h +13 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKFirmware.h +98 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKGroupOperation.h +100 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKKontaktResponse.h +85 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKManager.h +121 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKNearbyDevice.h +135 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h +513 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKOperation.h +116 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKPersonPosition.h +22 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h +86 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h +59 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKTrigger.h +94 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKTriggerContext.h +79 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KTKVenue.h +105 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/Kontakt.h +187 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KontaktSDK-Swift.h +1332 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/KontaktSDK.h +43 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/NSData+Kontakt.h +115 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/NSError+Kontakt.h +26 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/NSString+Kontakt.h +25 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Headers/NSURLRequest+Kontakt.h +44 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Info.plist +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/KontaktSDK +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +14106 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +14106 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/KontaktSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +428 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/_CodeSignature/CodeResources +894 -0
- package/ios/Frameworks/KontaktSDK.xcframework/ios-arm64_x86_64-simulator/KontaktSDK.framework/strip-frameworks.sh +72 -0
- package/ios/SpotnyBeaconScanner.swift +938 -0
- package/ios/SpotnySdk.h +10 -0
- package/ios/SpotnySdk.mm +127 -0
- package/lib/module/NativeSpotnySdk.js +5 -0
- package/lib/module/NativeSpotnySdk.js.map +1 -0
- package/lib/module/index.js +96 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeSpotnySdk.d.ts +18 -0
- package/lib/typescript/src/NativeSpotnySdk.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +81 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +169 -0
- package/src/NativeSpotnySdk.ts +29 -0
- package/src/index.tsx +151 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ahmad Freijeh
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
# spotny-sdk
|
|
2
|
+
|
|
3
|
+
A React Native SDK for real-time iBeacon proximity experiences. Detects nearby beacons, fetches campaigns, and fires tracking events automatically on iOS and Android — all tied to your authenticated user.
|
|
4
|
+
|
|
5
|
+
> Requires **React Native 0.73+** with the New Architecture (Turbo Modules) enabled.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install spotny-sdk
|
|
13
|
+
# or
|
|
14
|
+
yarn add spotny-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### iOS
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
cd ios && pod install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Add the following keys to your `Info.plist`:
|
|
24
|
+
|
|
25
|
+
```xml
|
|
26
|
+
<key>NSLocationWhenInUseUsageDescription</key>
|
|
27
|
+
<string>We use your location to detect nearby points of interest.</string>
|
|
28
|
+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
|
29
|
+
<string>We use your location in the background to detect nearby points of interest.</string>
|
|
30
|
+
<key>NSBluetoothAlwaysUsageDescription</key>
|
|
31
|
+
<string>We use Bluetooth to detect nearby points of interest.</string>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Enable **Background Modes** in Xcode → your app target → **Signing & Capabilities** → Background Modes:
|
|
35
|
+
|
|
36
|
+
- ✅ Location updates
|
|
37
|
+
- ✅ Uses Bluetooth LE accessories
|
|
38
|
+
|
|
39
|
+
### Android
|
|
40
|
+
|
|
41
|
+
Add to `AndroidManifest.xml`:
|
|
42
|
+
|
|
43
|
+
```xml
|
|
44
|
+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
|
45
|
+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
|
46
|
+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
47
|
+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
48
|
+
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { useEffect } from 'react';
|
|
57
|
+
import {
|
|
58
|
+
initialize,
|
|
59
|
+
startScanner,
|
|
60
|
+
stopScanner,
|
|
61
|
+
addBeaconsRangedListener,
|
|
62
|
+
addBeaconRegionListener,
|
|
63
|
+
} from 'spotny-sdk';
|
|
64
|
+
|
|
65
|
+
export default function App() {
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
// 1. Initialize once — call after the user is logged in
|
|
68
|
+
initialize({
|
|
69
|
+
token: 'YOUR_SDK_TOKEN', // from your Spotny dashboard
|
|
70
|
+
apiKey: 'your-brand-key', // identifies your app/brand
|
|
71
|
+
userId: currentUser.id, // your authenticated user ID
|
|
72
|
+
maxDetectionDistance: 10,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// 2. Listen for nearby beacons
|
|
76
|
+
const beaconSub = addBeaconsRangedListener(({ beacons, region }) => {
|
|
77
|
+
beacons.forEach((b) =>
|
|
78
|
+
console.log(
|
|
79
|
+
`${b.major}/${b.minor} — ${b.distance.toFixed(1)}m (${b.proximity})`
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// 3. Listen for region enter/exit
|
|
85
|
+
const regionSub = addBeaconRegionListener(({ event, region }) => {
|
|
86
|
+
console.log(`${event.toUpperCase()}: ${region}`);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// 4. Start scanning
|
|
90
|
+
startScanner();
|
|
91
|
+
|
|
92
|
+
return () => {
|
|
93
|
+
stopScanner();
|
|
94
|
+
beaconSub.remove();
|
|
95
|
+
regionSub.remove();
|
|
96
|
+
};
|
|
97
|
+
}, []);
|
|
98
|
+
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## API Reference
|
|
106
|
+
|
|
107
|
+
### Initialization
|
|
108
|
+
|
|
109
|
+
#### `initialize(config)`
|
|
110
|
+
|
|
111
|
+
**Must be called before any other SDK function.** Authenticates with the Spotny backend and obtains a session JWT that is automatically used for all subsequent API calls.
|
|
112
|
+
|
|
113
|
+
| Option | Type | Default | Description |
|
|
114
|
+
| -------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
115
|
+
| `token` | `string` | **required** | SDK token issued by Spotny for your app. Verified against the backend — rejects with `UNAUTHORIZED` if invalid. |
|
|
116
|
+
| `apiKey` | `string` | **required** | Identifies your brand or app (e.g. `'nike'`). Sent to the backend during verification. |
|
|
117
|
+
| `userId` | `string` | **required** | ID of the authenticated user (e.g. database UUID, hashed email). Embedded in the session JWT so all tracking events are tied to this user. |
|
|
118
|
+
| `maxDetectionDistance` | `number` | `8.0` | Maximum detection radius in metres. Beacons beyond this are ignored. |
|
|
119
|
+
| `distanceCorrectionFactor` | `number` | `0.5` | Multiplier applied to raw RSSI distance. Tune for your beacon TX power. |
|
|
120
|
+
|
|
121
|
+
Returns `Promise<string>`. **Rejects** if any required field is missing, the token is invalid, or the network request fails — handle the error before calling `startScanner()`.
|
|
122
|
+
|
|
123
|
+
> **Note:** The SDK is designed for authenticated (logged-in) users. Call `initialize()` after the user has signed in so their `userId` is available.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
await initialize({
|
|
127
|
+
token: 'YOUR_SDK_TOKEN',
|
|
128
|
+
apiKey: 'nike',
|
|
129
|
+
userId: currentUser.id,
|
|
130
|
+
maxDetectionDistance: 10,
|
|
131
|
+
distanceCorrectionFactor: 0.5,
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### JWT persistence & auto-refresh
|
|
136
|
+
|
|
137
|
+
The session JWT returned by `initialize()` is persisted to **Keychain** (iOS) / **SharedPreferences** (Android) and automatically restored when the app relaunches — so scanning resumes without calling `initialize()` again after a force-quit or crash.
|
|
138
|
+
|
|
139
|
+
If the JWT expires mid-session, the SDK transparently re-fetches it before the next API call. No action is required from your app.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Core Scanning
|
|
144
|
+
|
|
145
|
+
#### `startScanner()`
|
|
146
|
+
|
|
147
|
+
Starts iBeacon scanning. The SDK manages a persistent `device_id` internally (Keychain on iOS, SharedPreferences on Android — survives reinstalls).
|
|
148
|
+
|
|
149
|
+
Returns `Promise<string>`.
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
await startScanner();
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
#### `stopScanner()`
|
|
158
|
+
|
|
159
|
+
Stops scanning and cleans up all per-beacon state (sends `PROXIMITY_EXIT` events for any active beacons).
|
|
160
|
+
|
|
161
|
+
Returns `Promise<string>`.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
#### `isScanning()`
|
|
166
|
+
|
|
167
|
+
Returns `Promise<boolean>` — `true` if the scanner is currently active.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Permissions
|
|
172
|
+
|
|
173
|
+
#### `requestNotificationPermissions()` _(iOS only)_
|
|
174
|
+
|
|
175
|
+
Prompts the user for local notification permission (`alert`, `sound`, `badge`).
|
|
176
|
+
|
|
177
|
+
Returns `Promise<'granted' | 'denied'>`.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### Event Listeners
|
|
182
|
+
|
|
183
|
+
#### `addBeaconsRangedListener(callback)`
|
|
184
|
+
|
|
185
|
+
Fires when the set of nearby beacons changes, or every `debounceInterval` seconds (default 5 s) if nothing changed. The event is **deduplicated** — it does not fire every ranging cycle if proximity is unchanged.
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
const sub = addBeaconsRangedListener(({ beacons, region }) => {
|
|
189
|
+
beacons.forEach((b) => {
|
|
190
|
+
console.log(`Major ${b.major} / Minor ${b.minor}`);
|
|
191
|
+
console.log(`Distance: ${b.distance.toFixed(2)}m — ${b.proximity}`);
|
|
192
|
+
console.log(`RSSI: ${b.rssi} dBm`);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
sub.remove(); // call on cleanup
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Each beacon in the array:
|
|
200
|
+
|
|
201
|
+
| Field | Type | Description |
|
|
202
|
+
| ----------- | -------- | -------------------------------------------------------------- |
|
|
203
|
+
| `uuid` | `string` | Beacon proximity UUID |
|
|
204
|
+
| `major` | `number` | Beacon major value |
|
|
205
|
+
| `minor` | `number` | Beacon minor value |
|
|
206
|
+
| `distance` | `number` | Estimated distance in metres (after correction factor applied) |
|
|
207
|
+
| `rssi` | `number` | Raw signal strength in dBm |
|
|
208
|
+
| `proximity` | `string` | `'immediate'` \| `'near'` \| `'far'` \| `'unknown'` |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
#### `addBeaconRegionListener(callback)`
|
|
213
|
+
|
|
214
|
+
Fires when the user enters or exits a beacon region. Works in foreground, background, and terminated state (iOS).
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
const sub = addBeaconRegionListener(({ event, region, state }) => {
|
|
218
|
+
if (event === 'enter') console.log('Entered region', region);
|
|
219
|
+
if (event === 'exit') console.log('Left region', region);
|
|
220
|
+
if (event === 'determined') console.log('State for', region, '→', state);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
sub.remove(); // call on cleanup
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
| Field | Type | Description |
|
|
227
|
+
| -------- | -------- | ------------------------------------------------------------------ |
|
|
228
|
+
| `event` | `string` | `'enter'` \| `'exit'` \| `'determined'` |
|
|
229
|
+
| `region` | `string` | Region identifier |
|
|
230
|
+
| `state` | `string` | `'inside'` \| `'outside'` \| `'unknown'` (`determined` event only) |
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### Debug Helpers
|
|
235
|
+
|
|
236
|
+
#### `getDebugLogs()`
|
|
237
|
+
|
|
238
|
+
Returns the on-device debug log file as a string. Includes campaign fetch results and proximity events sent.
|
|
239
|
+
|
|
240
|
+
Returns `Promise<string>`.
|
|
241
|
+
|
|
242
|
+
#### `clearDebugLogs()`
|
|
243
|
+
|
|
244
|
+
Clears the on-device debug log file.
|
|
245
|
+
|
|
246
|
+
Returns `Promise<string>`.
|
|
247
|
+
|
|
248
|
+
#### `setDebounceInterval(seconds)`
|
|
249
|
+
|
|
250
|
+
Sets how often the `onBeaconsRanged` event is force-emitted even if proximity hasn't changed (default: `5`).
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
await setDebounceInterval(10); // emit at most every 10 s
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### `clearDebounceCache()`
|
|
257
|
+
|
|
258
|
+
Resets internal campaign-fetch cooldown state. Useful during testing.
|
|
259
|
+
|
|
260
|
+
#### `getDebounceStatus()`
|
|
261
|
+
|
|
262
|
+
Returns internal per-beacon timing state. Useful for debugging stuck campaigns.
|
|
263
|
+
|
|
264
|
+
Returns `Promise<Object>`.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## How It Works
|
|
269
|
+
|
|
270
|
+
1. `initialize()` sends your `token`, `apiKey`, and `userId` to the Spotny backend, which issues a session JWT. The JWT is persisted locally and auto-refreshed when it expires.
|
|
271
|
+
2. `startScanner()` begins monitoring for iBeacons with the Spotny UUID.
|
|
272
|
+
3. When a beacon is detected, the SDK fetches the associated campaign from the Spotny backend.
|
|
273
|
+
4. `NEARBY` events are sent automatically as the user moves closer or further.
|
|
274
|
+
5. `IMPRESSION_HEARTBEAT` events are sent every 10 s when the user is within 2 m of an active campaign.
|
|
275
|
+
6. On exit, `PROXIMITY_EXIT` is sent and all state is cleaned up.
|
|
276
|
+
|
|
277
|
+
All events are tied to the authenticated `userId` supplied during `initialize()` — no additional identity calls are required.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Platform Support
|
|
282
|
+
|
|
283
|
+
| Feature | iOS | Android |
|
|
284
|
+
| ------------------------ | --- | ------- |
|
|
285
|
+
| iBeacon ranging | ✅ | ✅ |
|
|
286
|
+
| Region enter/exit | ✅ | ✅ |
|
|
287
|
+
| Background scanning | ✅ | ✅ |
|
|
288
|
+
| Terminated-state wakeup | ✅ | ✅ |
|
|
289
|
+
| JWT persistence | ✅ | ✅ |
|
|
290
|
+
| Keychain device ID | ✅ | – |
|
|
291
|
+
| Notification permissions | ✅ | – |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Contributing
|
|
296
|
+
|
|
297
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
298
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
299
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
300
|
+
|
|
301
|
+
## License
|
|
302
|
+
|
|
303
|
+
MIT
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Installation
|
|
308
|
+
|
|
309
|
+
```sh
|
|
310
|
+
npm install spotny-sdk
|
|
311
|
+
# or
|
|
312
|
+
yarn add spotny-sdk
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### iOS
|
|
316
|
+
|
|
317
|
+
```sh
|
|
318
|
+
cd ios && pod install
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Add the following keys to your `Info.plist`:
|
|
322
|
+
|
|
323
|
+
```xml
|
|
324
|
+
<key>NSLocationWhenInUseUsageDescription</key>
|
|
325
|
+
<string>We use your location to detect nearby points of interest.</string>
|
|
326
|
+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
|
327
|
+
<string>We use your location in the background to detect nearby points of interest.</string>
|
|
328
|
+
<key>NSBluetoothAlwaysUsageDescription</key>
|
|
329
|
+
<string>We use Bluetooth to detect nearby points of interest.</string>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Enable **Background Modes** in Xcode → your app target → **Signing & Capabilities** → Background Modes:
|
|
333
|
+
|
|
334
|
+
- ✅ Location updates
|
|
335
|
+
- ✅ Uses Bluetooth LE accessories
|
|
336
|
+
|
|
337
|
+
### Android
|
|
338
|
+
|
|
339
|
+
Add to `AndroidManifest.xml`:
|
|
340
|
+
|
|
341
|
+
```xml
|
|
342
|
+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
|
343
|
+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
|
344
|
+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
345
|
+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
346
|
+
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Quick Start
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
import { useEffect } from 'react';
|
|
355
|
+
import {
|
|
356
|
+
initialize,
|
|
357
|
+
startScanner,
|
|
358
|
+
stopScanner,
|
|
359
|
+
addBeaconsRangedListener,
|
|
360
|
+
addBeaconRegionListener,
|
|
361
|
+
} from 'spotny-sdk';
|
|
362
|
+
|
|
363
|
+
export default function App() {
|
|
364
|
+
useEffect(() => {
|
|
365
|
+
// 1. Initialize once before anything else
|
|
366
|
+
initialize({
|
|
367
|
+
token: 'YOUR_SDK_TOKEN', // required — from your Spotny dashboard
|
|
368
|
+
source: 'nike',
|
|
369
|
+
maxDetectionDistance: 10,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
// 2. Listen for nearby beacons
|
|
373
|
+
const beaconSub = addBeaconsRangedListener(({ beacons, region }) => {
|
|
374
|
+
beacons.forEach((b) =>
|
|
375
|
+
console.log(
|
|
376
|
+
`${b.major}/${b.minor} — ${b.distance.toFixed(1)}m (${b.proximity})`
|
|
377
|
+
)
|
|
378
|
+
);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
// 3. Listen for region enter/exit
|
|
382
|
+
const regionSub = addBeaconRegionListener(({ event, region }) => {
|
|
383
|
+
console.log(`${event.toUpperCase()}: ${region}`);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// 4. Start scanning
|
|
387
|
+
startScanner();
|
|
388
|
+
|
|
389
|
+
return () => {
|
|
390
|
+
stopScanner();
|
|
391
|
+
beaconSub.remove();
|
|
392
|
+
regionSub.remove();
|
|
393
|
+
};
|
|
394
|
+
}, []);
|
|
395
|
+
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## API Reference
|
|
403
|
+
|
|
404
|
+
### Initialization
|
|
405
|
+
|
|
406
|
+
#### `initialize(config)`
|
|
407
|
+
|
|
408
|
+
**Must be called before any other SDK function.** Configures the SDK with your brand settings.
|
|
409
|
+
|
|
410
|
+
| Option | Type | Default | Description |
|
|
411
|
+
| -------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
412
|
+
| `token` | `string` | **required** | SDK token issued by Spotny for your app. Verified against the backend — rejects with `UNAUTHORIZED` if invalid. |
|
|
413
|
+
| `source` | `string` | – | Your brand or app identifier (e.g. `'nike'`). Sent with every tracking event. |
|
|
414
|
+
| `maxDetectionDistance` | `number` | `8.0` | Maximum detection radius in metres. Beacons beyond this are ignored. |
|
|
415
|
+
| `distanceCorrectionFactor` | `number` | `0.5` | Multiplier applied to raw RSSI distance. Tune for your beacon TX power. |
|
|
416
|
+
|
|
417
|
+
Returns `Promise<string>`. **Rejects** if the token is missing, invalid, or the network request fails — handle the error before calling `startScanner()`.
|
|
418
|
+
|
|
419
|
+
```ts
|
|
420
|
+
await initialize({
|
|
421
|
+
token: 'YOUR_SDK_TOKEN',
|
|
422
|
+
source: 'nike',
|
|
423
|
+
maxDetectionDistance: 10,
|
|
424
|
+
distanceCorrectionFactor: 0.5,
|
|
425
|
+
});
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
### Core Scanning
|
|
431
|
+
|
|
432
|
+
#### `startScanner()`
|
|
433
|
+
|
|
434
|
+
Starts iBeacon scanning. The SDK manages a fully anonymous `device_id` internally (stored in Keychain on iOS, SharedPreferences on Android — persists across launches).
|
|
435
|
+
|
|
436
|
+
Returns `Promise<string>`.
|
|
437
|
+
|
|
438
|
+
```ts
|
|
439
|
+
await startScanner();
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
#### `stopScanner()`
|
|
445
|
+
|
|
446
|
+
Stops scanning and cleans up all per-beacon state (sends `PROXIMITY_EXIT` events for any active beacons).
|
|
447
|
+
|
|
448
|
+
Returns `Promise<string>`.
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
#### `isScanning()`
|
|
453
|
+
|
|
454
|
+
Returns `Promise<boolean>` — `true` if the scanner is currently active.
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
### Permissions
|
|
459
|
+
|
|
460
|
+
#### `requestNotificationPermissions()` _(iOS only)_
|
|
461
|
+
|
|
462
|
+
Prompts the user for local notification permission (`alert`, `sound`, `badge`).
|
|
463
|
+
|
|
464
|
+
Returns `Promise<'granted' | 'denied'>`.
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
### Event Listeners
|
|
469
|
+
|
|
470
|
+
#### `addBeaconsRangedListener(callback)`
|
|
471
|
+
|
|
472
|
+
Fires when the set of nearby beacons changes, or every `debounceInterval` seconds (default 5 s) if nothing changed. The event is **deduplicated** — it does not fire every ranging cycle if proximity is unchanged.
|
|
473
|
+
|
|
474
|
+
```ts
|
|
475
|
+
const sub = addBeaconsRangedListener(({ beacons, region }) => {
|
|
476
|
+
beacons.forEach((b) => {
|
|
477
|
+
console.log(`Major ${b.major} / Minor ${b.minor}`);
|
|
478
|
+
console.log(`Distance: ${b.distance.toFixed(2)}m — ${b.proximity}`);
|
|
479
|
+
console.log(`RSSI: ${b.rssi} dBm`);
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
sub.remove(); // call on cleanup
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
Each beacon in the array:
|
|
487
|
+
|
|
488
|
+
| Field | Type | Description |
|
|
489
|
+
| ----------- | -------- | -------------------------------------------------------------- |
|
|
490
|
+
| `uuid` | `string` | Beacon proximity UUID |
|
|
491
|
+
| `major` | `number` | Beacon major value |
|
|
492
|
+
| `minor` | `number` | Beacon minor value |
|
|
493
|
+
| `distance` | `number` | Estimated distance in metres (after correction factor applied) |
|
|
494
|
+
| `rssi` | `number` | Raw signal strength in dBm |
|
|
495
|
+
| `proximity` | `string` | `'immediate'` \| `'near'` \| `'far'` \| `'unknown'` |
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
#### `addBeaconRegionListener(callback)`
|
|
500
|
+
|
|
501
|
+
Fires when the user enters or exits a beacon region. Works in foreground, background, and terminated state (iOS).
|
|
502
|
+
|
|
503
|
+
```ts
|
|
504
|
+
const sub = addBeaconRegionListener(({ event, region, state }) => {
|
|
505
|
+
if (event === 'enter') console.log('Entered region', region);
|
|
506
|
+
if (event === 'exit') console.log('Left region', region);
|
|
507
|
+
if (event === 'determined') console.log('State for', region, '→', state);
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
sub.remove(); // call on cleanup
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
| Field | Type | Description |
|
|
514
|
+
| -------- | -------- | ------------------------------------------------------------------ |
|
|
515
|
+
| `event` | `string` | `'enter'` \| `'exit'` \| `'determined'` |
|
|
516
|
+
| `region` | `string` | Region identifier |
|
|
517
|
+
| `state` | `string` | `'inside'` \| `'outside'` \| `'unknown'` (`determined` event only) |
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
### Debug Helpers
|
|
522
|
+
|
|
523
|
+
#### `getDebugLogs()`
|
|
524
|
+
|
|
525
|
+
Returns the on-device debug log file as a string. Includes campaign fetch results and proximity events sent.
|
|
526
|
+
|
|
527
|
+
Returns `Promise<string>`.
|
|
528
|
+
|
|
529
|
+
#### `clearDebugLogs()`
|
|
530
|
+
|
|
531
|
+
Clears the on-device debug log file.
|
|
532
|
+
|
|
533
|
+
Returns `Promise<string>`.
|
|
534
|
+
|
|
535
|
+
#### `setDebounceInterval(seconds)`
|
|
536
|
+
|
|
537
|
+
Sets how often the `onBeaconsRanged` event is force-emitted even if proximity hasn't changed (default: `5`).
|
|
538
|
+
|
|
539
|
+
```ts
|
|
540
|
+
await setDebounceInterval(10); // emit at most every 10 s
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
#### `clearDebounceCache()`
|
|
544
|
+
|
|
545
|
+
Resets internal campaign-fetch cooldown state. Useful during testing.
|
|
546
|
+
|
|
547
|
+
#### `getDebounceStatus()`
|
|
548
|
+
|
|
549
|
+
Returns internal per-beacon timing state. Useful for debugging stuck campaigns.
|
|
550
|
+
|
|
551
|
+
Returns `Promise<Object>`.
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
## How It Works
|
|
556
|
+
|
|
557
|
+
1. `initialize()` sets your brand config.
|
|
558
|
+
2. `startScanner()` begins monitoring for iBeacons with the Spotny UUID.
|
|
559
|
+
3. When a beacon is detected, the SDK fetches the associated campaign from the Spotny backend.
|
|
560
|
+
4. `NEARBY` events are sent automatically as the user moves closer or further.
|
|
561
|
+
5. `IMPRESSION_HEARTBEAT` events are sent every 10 s when the user is within 2 m of an active campaign.
|
|
562
|
+
6. On exit, `PROXIMITY_EXIT` is sent and all state is cleaned up.
|
|
563
|
+
|
|
564
|
+
The SDK is **fully anonymous** — it generates a persistent `device_id` (Keychain on iOS, SharedPreferences on Android) that survives app reinstalls. No user identity is collected or sent.
|
|
565
|
+
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
## Platform Support
|
|
569
|
+
|
|
570
|
+
| Feature | iOS | Android |
|
|
571
|
+
| ------------------------ | --- | ------- |
|
|
572
|
+
| iBeacon ranging | ✅ | ✅ |
|
|
573
|
+
| Region enter/exit | ✅ | ✅ |
|
|
574
|
+
| Background scanning | ✅ | ✅ |
|
|
575
|
+
| Terminated-state wakeup | ✅ | ✅ |
|
|
576
|
+
| Keychain device ID | ✅ | – |
|
|
577
|
+
| Notification permissions | ✅ | – |
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
## Contributing
|
|
582
|
+
|
|
583
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
584
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
585
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
586
|
+
|
|
587
|
+
## License
|
|
588
|
+
|
|
589
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "SpotnySdk"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/Spotny-SA/spotny-sdk.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
|
|
19
|
+
# All three frameworks are pre-built with Swift 6.2 and bundled — no SPM or manual setup needed.
|
|
20
|
+
# DO NOT also add KontaktSDK/CBORCoding/Half via SPM — it causes duplicate framework errors.
|
|
21
|
+
s.vendored_frameworks = [
|
|
22
|
+
"ios/Frameworks/KontaktSDK.xcframework",
|
|
23
|
+
"ios/Frameworks/CBORCoding.xcframework",
|
|
24
|
+
"ios/Frameworks/Half.xcframework"
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
s.pod_target_xcconfig = {
|
|
30
|
+
"SWIFT_VERSION" => "5.0",
|
|
31
|
+
"CLANG_ENABLE_MODULES" => "YES"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
install_modules_dependencies(s)
|
|
35
|
+
end
|