├── images ├── bundledrop.png ├── frameworkdrop.png └── usagedescription.png ├── Beaconstac └── Beaconstac.framework │ ├── Beaconstac │ ├── Info.plist │ ├── BeaconstacModel.momd │ ├── BeaconstacModel.mom │ ├── VersionInfo.plist │ ├── BeaconstacModel 2.mom │ ├── BeaconstacModel 3.mom │ ├── BeaconstacModel 4.mom │ ├── BeaconstacModel 5.mom │ ├── BeaconstacModel 6.mom │ ├── BeaconstacModel 7.mom │ ├── BeaconstacModel 8.mom │ ├── BeaconstacModel 9.mom │ ├── BeaconstacModel 10.mom │ ├── BeaconstacModel 11.mom │ ├── BeaconstacModel 12.mom │ └── BeaconstacModel 12.omo │ ├── Modules │ ├── Beaconstac.swiftmodule │ │ ├── arm64-apple-ios.swiftdoc │ │ ├── arm64-apple-ios.swiftmodule │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ ├── Project │ │ │ ├── arm64-apple-ios.swiftsourceinfo │ │ │ └── x86_64-apple-ios-simulator.swiftsourceinfo │ │ ├── x86_64-apple-ios-simulator.swiftmodule │ │ ├── arm64-apple-ios.swiftinterface │ │ ├── arm64-apple-ios.private.swiftinterface │ │ ├── x86_64-apple-ios-simulator.swiftinterface │ │ └── x86_64-apple-ios-simulator.private.swiftinterface │ └── module.modulemap │ └── Headers │ └── Beaconstac.h ├── BeaconstacSampleApp ├── Podfile ├── Pods │ ├── Target Support Files │ │ ├── EddystoneScanner │ │ │ ├── EddystoneScanner.modulemap │ │ │ ├── EddystoneScanner-dummy.m │ │ │ ├── EddystoneScanner-prefix.pch │ │ │ ├── EddystoneScanner-umbrella.h │ │ │ ├── EddystoneScanner.xcconfig │ │ │ ├── EddystoneScanner.debug.xcconfig │ │ │ ├── EddystoneScanner.release.xcconfig │ │ │ └── EddystoneScanner-Info.plist │ │ └── Pods-BeaconstacSampleApp │ │ │ ├── Pods-BeaconstacSampleApp.modulemap │ │ │ ├── Pods-BeaconstacSampleApp-dummy.m │ │ │ ├── Pods-BeaconstacSampleApp-umbrella.h │ │ │ ├── Pods-BeaconstacSampleApp-Info.plist │ │ │ ├── Pods-BeaconstacSampleApp.debug.xcconfig │ │ │ ├── Pods-BeaconstacSampleApp.release.xcconfig │ │ │ ├── Pods-BeaconstacSampleApp-acknowledgements.markdown │ │ │ ├── Pods-BeaconstacSampleApp-acknowledgements.plist │ │ │ └── Pods-BeaconstacSampleApp-frameworks.sh │ ├── Manifest.lock │ └── EddystoneScanner │ │ ├── EddystoneScanner │ │ ├── Constants.swift │ │ ├── RSSIFilters │ │ │ ├── RSSIFilter.swift │ │ │ ├── ARMAFilter.swift │ │ │ ├── KalmanFilter.swift │ │ │ ├── GaussianFilter.swift │ │ │ └── RunningAverageFilter.swift │ │ ├── EddystoneRFC │ │ │ ├── Util.swift │ │ │ ├── Models │ │ │ │ ├── BeaconID.swift │ │ │ │ ├── Telemetry.swift │ │ │ │ └── Beacon.swift │ │ │ └── Eddystone.swift │ │ ├── DispatchTimer.swift │ │ ├── SafeSet.swift │ │ └── Scanner.swift │ │ ├── LICENSE │ │ └── README.md ├── BeaconstacSampleApp.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── BeaconstacSampleApp.xcscheme ├── BeaconstacSampleApp.xcworkspace │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── contents.xcworkspacedata ├── Podfile.lock └── BeaconstacSampleApp │ ├── BeaconTableViewCell.swift │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.swift │ ├── AppDelegate.swift │ └── BeaconTableViewCell.xib ├── .gitignore ├── Beaconstac.podspec ├── LICENSE └── CHANGELOG.md /images/bundledrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/images/bundledrop.png -------------------------------------------------------------------------------- /images/frameworkdrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/images/frameworkdrop.png -------------------------------------------------------------------------------- /images/usagedescription.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/images/usagedescription.png -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Beaconstac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Beaconstac -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Info.plist -------------------------------------------------------------------------------- /BeaconstacSampleApp/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | target 'BeaconstacSampleApp' do 4 | use_frameworks! 5 | pod 'EddystoneScanner', '~> 1.2.14' 6 | end 7 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/VersionInfo.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/VersionInfo.plist -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 2.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 2.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 3.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 3.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 4.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 4.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 5.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 5.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 6.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 6.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 7.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 7.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 8.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 8.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 9.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 9.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 10.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 10.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 11.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 11.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 12.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 12.mom -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 12.omo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/BeaconstacModel.momd/BeaconstacModel 12.omo -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.swiftmodule -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner.modulemap: -------------------------------------------------------------------------------- 1 | framework module EddystoneScanner { 2 | umbrella header "EddystoneScanner-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_EddystoneScanner : NSObject 3 | @end 4 | @implementation PodsDummy_EddystoneScanner 5 | @end 6 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.swiftmodule -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BeaconstacSampleApp { 2 | umbrella header "Pods-BeaconstacSampleApp-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BeaconstacSampleApp : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BeaconstacSampleApp 5 | @end 6 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beaconstac/iOS-SDK/HEAD/Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Beaconstac { 2 | umbrella header "Beaconstac.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Beaconstac.Swift { 9 | header "Beaconstac-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - EddystoneScanner (1.2.14) 3 | 4 | DEPENDENCIES: 5 | - EddystoneScanner (~> 1.2.14) 6 | 7 | SPEC REPOS: 8 | trunk: 9 | - EddystoneScanner 10 | 11 | SPEC CHECKSUMS: 12 | EddystoneScanner: dd6495655816841af2afd0370d9a819491d79c63 13 | 14 | PODFILE CHECKSUM: 33fde748ce186e76738717d603ad45bd47d655f3 15 | 16 | COCOAPODS: 1.11.3 17 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - EddystoneScanner (1.2.14) 3 | 4 | DEPENDENCIES: 5 | - EddystoneScanner (~> 1.2.14) 6 | 7 | SPEC REPOS: 8 | trunk: 9 | - EddystoneScanner 10 | 11 | SPEC CHECKSUMS: 12 | EddystoneScanner: dd6495655816841af2afd0370d9a819491d79c63 13 | 14 | PODFILE CHECKSUM: 33fde748ce186e76738717d603ad45bd47d655f3 15 | 16 | COCOAPODS: 1.11.3 17 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double EddystoneScannerVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char EddystoneScannerVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_BeaconstacSampleAppVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_BeaconstacSampleAppVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/Constants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Constants.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 10/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// Constants 13 | /// 14 | /// Keeps track of all the constants used in the project 15 | /// 16 | internal class Constants { 17 | static let BEACON_OPERATION_QUEUE_LABEL = "com.eddystonescanner.queue.blescanner" 18 | static let DISPATCH_TIMER_QUEUE_LABEL = "com.eddystonescanner.queue.dispatchtimer" 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Headers/Beaconstac.h: -------------------------------------------------------------------------------- 1 | // 2 | // Beaconstac.h 3 | // Beaconstac 4 | // 5 | // Created by Sachin Vas on 06/11/17. 6 | // Copyright © 2017 MobStac. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | //! Project version number for Beaconstac. 13 | FOUNDATION_EXPORT double BeaconstacVersionNumber; 14 | 15 | //! Project version string for Beaconstac. 16 | FOUNDATION_EXPORT const unsigned char BeaconstacVersionString[]; 17 | 18 | // In this header, you should import all the public headers of your framework using statements like #import 19 | 20 | 21 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CoreBluetooth" -framework "Foundation" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/EddystoneScanner 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/BeaconTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeaconTableViewCell.swift 3 | // SampleApp 4 | // 5 | // Created by Sachin Vas on 11/12/17. 6 | // Copyright © 2017 MobStac. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BeaconTableViewCell: UITableViewCell { 12 | 13 | @IBOutlet weak var name: UILabel! 14 | @IBOutlet weak var minor: UILabel! 15 | @IBOutlet weak var major: UILabel! 16 | @IBOutlet weak var uuid: UILabel! 17 | @IBOutlet weak var rssi: UILabel! 18 | @IBOutlet weak var serialNumber: UILabel! 19 | 20 | override func awakeFromNib() { 21 | super.awakeFromNib() 22 | } 23 | 24 | override func setSelected(_ selected: Bool, animated: Bool) { 25 | super.setSelected(selected, animated: animated) 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/RSSIFilters/RSSIFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RSSIFilter.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Sachin Vas on 22/02/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// FilterType 13 | /// 14 | /// Enum to define the filter to use 15 | @objc public enum RSSIFilterType: Int { 16 | case kalman 17 | case arma 18 | case gaussian 19 | case runningAverage 20 | } 21 | 22 | /// 23 | /// RSSIFilterDelegate 24 | /// 25 | /// RSSI signal filter protocol that all filters need to conform to 26 | /// 27 | internal protocol RSSIFilter { 28 | /// Defines the filter type 29 | var filterType: RSSIFilterType { get } 30 | 31 | /// Filtered RSSI value 32 | var filteredRSSI: Int? { get } 33 | 34 | /// Function to filter RSSI on current signal 35 | func calculate(forRSSI rssi: Int) 36 | } 37 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CoreBluetooth" -framework "Foundation" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/EddystoneScanner 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CoreBluetooth" -framework "Foundation" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/EddystoneScanner 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/EddystoneScanner/EddystoneScanner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.2.14 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Beaconstac.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Beaconstac' 3 | s.version = '3.2.12' 4 | s.swift_version = '5.0' 5 | s.summary = 'iOS library for iBeacon devices' 6 | 7 | s.homepage = 'https://github.com/Beaconstac/iOS-SDK' 8 | s.authors = { 'MobStac Inc.' => 'support@beaconstac.com' } 9 | 10 | s.license = { :type => 'MIT', :file => 'LICENSE' } 11 | 12 | s.source = { :git => 'https://github.com/Beaconstac/iOS-SDK.git', :tag => "#{s.version}" } 13 | 14 | s.pod_target_xcconfig = { 15 | 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' 16 | } 17 | 18 | s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } 19 | 20 | s.vendored_frameworks = 'Beaconstac/Beaconstac.framework' 21 | 22 | s.dependency 'EddystoneScanner' 23 | 24 | s.frameworks = 'CoreData', 'SystemConfiguration', 'CoreBluetooth', 'CoreLocation', 'UserNotifications', 'SafariServices' 25 | 26 | s.requires_arc = true 27 | s.ios.deployment_target = "11.0" 28 | end 29 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Beaconstac 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Beaconstac 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner/EddystoneScanner.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "CoreBluetooth" -framework "EddystoneScanner" -framework "Foundation" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/EddystoneScanner/EddystoneScanner.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "CoreBluetooth" -framework "EddystoneScanner" -framework "Foundation" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/EddystoneRFC/Util.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Util.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 14/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public extension Collection where Iterator.Element == UInt8 { 12 | 13 | // 14 | // Converts the UInt8 array into a Data object 15 | // 16 | var data: Data { 17 | return Data(self) 18 | } 19 | 20 | /// 21 | /// Converts the UInt8 array into its quvivalent hex string 22 | /// 23 | var hexString: String { 24 | return map{ String(format: "%02X", $0) }.joined() 25 | } 26 | 27 | } 28 | 29 | /** 30 | Convert the bytes array into a UInt object 31 | 32 | - Parameter byteArray: The `ArraySlice` byte array 33 | */ 34 | internal func bytesToUInt(byteArray: ArraySlice) -> UInt? { 35 | guard byteArray.count <= 4 else { 36 | debugPrint("Byte array cannot be converted into a UInt object. Elements greater that 4") 37 | return nil 38 | } 39 | 40 | var result: UInt = 0 41 | for idx in 0..<(byteArray.count) { 42 | let shiftAmount = UInt((byteArray.count) - idx - 1) * 8 43 | let value = UInt(byteArray[byteArray.startIndex + idx]) 44 | result += value << shiftAmount 45 | } 46 | return result 47 | } 48 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## EddystoneScanner 5 | 6 | MIT License 7 | 8 | Copyright (c) 2018 Beaconstac 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/RSSIFilters/ARMAFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARMAFilter.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Sachin Vas on 22/02/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// ArmaFilter 13 | /// 14 | /// This filter calculates its rssi on base of an auto regressive moving average (ARMA) 15 | /// It needs only the current value to do this; 16 | /// the general formula is n(t) = n(t-1) - c * (n(t-1) - n(t)) 17 | /// where c is a coefficient, that denotes the smoothness - the lower the value, the smoother the average 18 | /// Note: a smoother average needs longer to "settle down" 19 | /// Note: For signals, that change rather frequently (say, 1Hz or faster) and tend to vary more a recommended value would be 0,1 (that means the actual value is changed by 10% of the difference between the actual measurement and the actual average) 20 | /// For signals at lower rates (10Hz) a value of 0.25 to 0.5 would be appropriate 21 | //// 22 | internal class ArmaFilter: RSSIFilter { 23 | 24 | /// Stores the filter type 25 | internal let filterType: RSSIFilterType = .arma 26 | 27 | /// Filtered RSSI value 28 | internal var filteredRSSI: Int? 29 | 30 | private let sArmaCoefficient: Float 31 | 32 | private let ARMA_FILTER_PROCESS_NOISE: Float = 0.15 33 | 34 | internal init() { 35 | sArmaCoefficient = ARMA_FILTER_PROCESS_NOISE 36 | } 37 | 38 | internal func calculate(forRSSI rssi: Int) { 39 | guard rssi < 0 else { 40 | return 41 | } 42 | 43 | if let x = filteredRSSI { 44 | filteredRSSI = Int(Float(x) - sArmaCoefficient * Float(x - rssi)) 45 | return 46 | } 47 | filteredRSSI = rssi 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/README.md: -------------------------------------------------------------------------------- 1 | # EddystoneScanner-iOS-SDK 2 | 3 | Eddystone Scanner is library written in Swift that scans for eddystone beacons and maintains a list of all the nearby beacons. 4 | 5 | ## Installation 6 | 7 | ### CocoaPods 8 | 9 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: 10 | 11 | ```bash 12 | $ gem install cocoapods 13 | ``` 14 | 15 | > CocoaPods 1.1+ is required to build EddystoneScanner. 16 | 17 | To integrate EddystoneScanner into your Xcode project using CocoaPods, specify it in your `Podfile`: 18 | 19 | ```ruby 20 | source 'https://github.com/CocoaPods/Specs.git' 21 | platform :ios, '10.0' 22 | use_frameworks! 23 | 24 | target '' do 25 | pod 'EddystoneScanner' 26 | end 27 | ``` 28 | 29 | Then, run the following command: 30 | 31 | ```bash 32 | $ pod install 33 | ``` 34 | 35 | ### Manually 36 | 37 | If you prefer not to use any of the aforementioned dependency managers, you can integrate EddystoneScanner into your project manually. 38 | 39 | #### Embedded Framework 40 | 41 | - Go to the releases [section](https://github.com/Beaconstac/EddystoneScanner-iOS-SDK/releases) and download the framework from the latest release. 42 | > You'll see a file named EddystoneScanner.framework.zip. 43 | - Download the framwork and add it to your project. 44 | - Do not forget to check 'Copy files if needed' checkbox. 45 | 46 | 47 | ## Background beacon scanning 48 | 49 | To support background scanning of beacons add `bluetooth-central` to the apps `Info.plist` as one of the values for `UIBackgroundModes` array or just do it from the Capabilities section of the app. 50 | 51 | ![Xcode Capability Section](https://raw.githubusercontent.com/Beaconstac/EddystoneScanner-iOS-SDK/master/doc_images/background_scanning_capability.png) 52 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/DispatchTimer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchTimer.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 30/11/17. 6 | // Copyright © 2017 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// DispatchTimerDelegate 13 | /// 14 | /// Implement this to receive callbacks when the timer is called 15 | @objc public protocol DispatchTimerDelegate { 16 | func timerCalled(timer: DispatchTimer?) 17 | } 18 | 19 | /// 20 | /// DispatchTimer 21 | /// 22 | /// Timer class to create a background timer on a queue 23 | /// 24 | public class DispatchTimer: NSObject { 25 | 26 | // MARK: Public properties 27 | /// Interval to run the timer 28 | public let repeatingInterval: Double 29 | /// DispatchTimerDelegate to recieve delegate callbacks 30 | public var delegate: DispatchTimerDelegate? 31 | 32 | // MARK: Private properties 33 | private var sourceTimer: DispatchSourceTimer? 34 | private let queue: DispatchQueue 35 | private var isTimerRunning = false 36 | 37 | public init(repeatingInterval: Double, queueLabel: String) { 38 | queue = DispatchQueue(label: queueLabel) 39 | sourceTimer = DispatchSource.makeTimerSource(queue: queue) 40 | 41 | self.repeatingInterval = repeatingInterval 42 | 43 | super.init() 44 | } 45 | 46 | /// Start the timer 47 | public func startTimer() { 48 | guard !isTimerRunning else { 49 | return 50 | } 51 | isTimerRunning = true 52 | sourceTimer?.schedule(deadline: .now() + repeatingInterval, repeating: repeatingInterval, leeway: .seconds(10)) 53 | sourceTimer?.setEventHandler { [weak self] in 54 | self?.delegate?.timerCalled(timer: self) 55 | } 56 | sourceTimer?.resume() 57 | } 58 | 59 | /// Stop the timer 60 | public func stopTimer() { 61 | guard isTimerRunning else { 62 | return 63 | } 64 | isTimerRunning = false 65 | self.sourceTimer?.suspend() 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2018 Beaconstac 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | EddystoneScanner 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Generated by CocoaPods - https://cocoapods.org 49 | Title 50 | 51 | Type 52 | PSGroupSpecifier 53 | 54 | 55 | StringsTable 56 | Acknowledgements 57 | Title 58 | Acknowledgements 59 | 60 | 61 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 3.1.7 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSBluetoothAlwaysUsageDescription 24 | Beaconstac SDK Demo 25 | NSBluetoothPeripheralUsageDescription 26 | Range Beacons 27 | NSLocationAlwaysAndWhenInUsageDescription 28 | To detect Beacons 29 | NSLocationAlwaysAndWhenInUseUsageDescription 30 | Beaconstac SDK Demo 31 | NSLocationAlwaysUsageDescription 32 | Beaconstac SDK Demo 33 | NSLocationUsageDescription 34 | Beaconstac SDK Demo 35 | NSLocationWhenInUseUsageDescription 36 | Beaconstac SDK Demo 37 | UIBackgroundModes 38 | 39 | bluetooth-central 40 | location 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | bluetooth-le 50 | 51 | UISupportedInterfaceOrientations 52 | 53 | UIInterfaceOrientationPortrait 54 | UIInterfaceOrientationLandscapeLeft 55 | UIInterfaceOrientationLandscapeRight 56 | 57 | UISupportedInterfaceOrientations~ipad 58 | 59 | UIInterfaceOrientationPortrait 60 | UIInterfaceOrientationPortraitUpsideDown 61 | UIInterfaceOrientationLandscapeLeft 62 | UIInterfaceOrientationLandscapeRight 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/RSSIFilters/KalmanFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KalmanFilter.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 25/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// KalmanFilter 13 | /// 14 | /// Implements the Kalman filter as described wonderfully by 15 | /// Wouter Bulten @ https://www.wouterbulten.nl/blog/tech/kalman-filters-explained-removing-noise-from-rssi-signals/ 16 | internal class KalmanFilter: RSSIFilter { 17 | 18 | /// Stores the filter type 19 | internal let filterType: RSSIFilterType = .kalman 20 | 21 | /// Filtered RSSI value 22 | internal var filteredRSSI: Int? { 23 | get { 24 | guard let x1 = x else { 25 | return 0 26 | } 27 | return Int(x1) 28 | } 29 | } 30 | 31 | /// Process noise 32 | private let R: Float 33 | 34 | /// Measurement noise 35 | private let Q: Float 36 | 37 | /// State vector 38 | private let A: Float 39 | 40 | /// Control vector 41 | private let B: Float 42 | 43 | /// Measurement vector 44 | private let C: Float 45 | 46 | /// Last calculated value 47 | private var x: Float? 48 | 49 | private var cov: Float = 0 50 | 51 | /// Noise constants 52 | private let KALMAN_FILTER_PROCESS_NOISE: Float = 0.008 53 | private let KALMAN_FILTER_MEASUREMENT_NOISE: Float = 1.0 54 | 55 | /** 56 | * Create 1-dimensional kalman filter 57 | */ 58 | internal init() { 59 | self.R = KALMAN_FILTER_PROCESS_NOISE 60 | self.Q = KALMAN_FILTER_MEASUREMENT_NOISE 61 | self.A = 1 62 | self.B = 0 63 | self.C = 1 64 | } 65 | 66 | /** 67 | Calculates the filterred RSSI for incoming RSSI value 68 | 69 | - Parameter z: The incoming data 70 | */ 71 | internal func calculate(forRSSI rssi: Int) { 72 | guard let x1 = x else { 73 | self.x = (1 / self.C) * Float(rssi) 74 | self.cov = (1 / self.C) * self.Q * (1 / self.C) 75 | return 76 | } 77 | 78 | // Compute prediction 79 | let predX = (self.A * x1) + (self.B * 0) 80 | let predCov = ((self.A * self.cov) * self.A) + self.R 81 | 82 | // Kalman gain 83 | let K = predCov * self.C * (1 / ((self.C * predCov * self.C) + self.Q)) 84 | 85 | // Correction 86 | self.x = predX + K * (Float(rssi) - (self.C * predX)) 87 | self.cov = predCov - (K * self.C * predCov) 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/EddystoneRFC/Models/BeaconID.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EddystoneBeaconID.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 10/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Beacon type. 13 | 14 | - eddystone: 10 bytes namespace + 6 bytes instance = 16 byte ID. 15 | - eddystoneEID: 8 byte ID 16 | */ 17 | public enum BeaconType { 18 | case eddystone 19 | case eddystoneEID 20 | } 21 | 22 | /// 23 | /// EddystoneBeaconID 24 | /// 25 | /// Uniquely identifies an Eddystone compliant beacon. 26 | /// 27 | @objc public class BeaconID: NSObject { 28 | 29 | public let beaconType: BeaconType 30 | 31 | /// 32 | /// unique 16-byte Beacon ID composed of a 10-byte namespace and a 6-byte instance 33 | /// Get hexString by doing beaconID.hexString 34 | /// 35 | @objc public let beaconID: [UInt8] 36 | 37 | /// 38 | /// 10 byte raw namespace data 39 | /// 40 | @objc public var namespace: Array? { 41 | guard beaconType == .eddystone else { 42 | return nil 43 | } 44 | return Array(beaconID[..<10]) 45 | } 46 | 47 | /// 48 | /// 6 byte raw namespace data 49 | /// 50 | @objc public var instance: Array? { 51 | guard beaconType == .eddystone else { 52 | return nil 53 | } 54 | return Array(beaconID[10..<16]) 55 | } 56 | 57 | /// 58 | /// 8 byte raw Ephemeral Identifier 59 | /// 60 | @objc public var ephemeralIdentifier: Array? { 61 | guard beaconType == .eddystoneEID else { 62 | return nil 63 | } 64 | return Array(beaconID[..<8]) 65 | } 66 | 67 | /// 68 | /// Base64 encoded string of the byte beacon ID data 69 | /// 70 | @objc public var beaconAdvertisedId: String { 71 | return beaconID.data.base64EncodedString() 72 | } 73 | 74 | /** 75 | Internal initialiser 76 | 77 | - Parameter beaconType: BeaconType 78 | - Parameter beaconID: BeaconID 79 | */ 80 | internal init(beaconType: BeaconType, beaconID: [UInt8]) { 81 | self.beaconID = beaconID 82 | self.beaconType = beaconType 83 | 84 | super.init() 85 | } 86 | } 87 | 88 | 89 | extension BeaconID { 90 | // MARK: CustomStringConvertible protocol requirments 91 | override public var description: String { 92 | return beaconID.hexString 93 | } 94 | } 95 | 96 | extension BeaconID { 97 | // MARK: Equatable protocol requirments 98 | public static func == (lhs: BeaconID, rhs: BeaconID) -> Bool { 99 | return lhs.beaconID == rhs.beaconID && 100 | lhs.beaconType == rhs.beaconType 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/RSSIFilters/GaussianFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GaussianFilter.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Sachin Vas on 27/02/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// A combination of bias based filter algorithms from the Beaonstac SDK 13 | /// and Gaussian filter algorithm. 14 | /// Its stores the last 10 rssi values, ignores the top and bottom 3, and uses the mean of remaining rssi values 15 | /// https://stackoverflow.com/a/33627325/3106978 16 | /// 17 | 18 | internal class GaussianFilter: RSSIFilter { 19 | 20 | private let RECORDED_RSSI_COUNT = 10 21 | 22 | internal enum BeaconAffinity: Int { 23 | case none = 0 24 | case low = 3 25 | case medium 26 | case high 27 | } 28 | 29 | /// Stores the filter type 30 | var filterType: RSSIFilterType 31 | 32 | /// Filtered RSSI value 33 | var filteredRSSI: Int? { 34 | get { 35 | guard recordedRSSI.count > RECORDED_RSSI_COUNT else { 36 | return nil 37 | } 38 | 39 | let sigma = 3.0 40 | var median: Double 41 | let sorted = recordedRSSI.sorted(by: { $0 < $1 }) 42 | 43 | var filtered: [Int] = [] 44 | 45 | for i in 3..<7 { 46 | filtered.append(sorted[i]) 47 | } 48 | 49 | let len = filtered.count 50 | 51 | if len == 1 { 52 | median = Double(filtered[0]) 53 | } else if len % 2 == 0 { 54 | median = (Double(filtered[len / 2]) + Double(filtered[len / 2 - 1])) / 2 55 | } else { 56 | median = Double(filtered[len / 2]) 57 | } 58 | 59 | var mean = 0, meanCount = 0 60 | 61 | for i in 0.. 0 { 70 | mean /= meanCount 71 | } else { 72 | mean = previousRSSI ?? 0 73 | } 74 | previousRSSI = mean + bias 75 | return previousRSSI 76 | } 77 | } 78 | 79 | private var bias: Int 80 | 81 | private var recordedRSSI: [Int] = [] 82 | 83 | private var previousRSSI: Int? 84 | 85 | internal init() { 86 | filterType = .gaussian 87 | bias = BeaconAffinity.medium.rawValue 88 | } 89 | 90 | internal func calculate(forRSSI rssi: Int) { 91 | if recordedRSSI.count > RECORDED_RSSI_COUNT { 92 | recordedRSSI.remove(at: 0) 93 | } 94 | recordedRSSI.append(rssi) 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/RSSIFilters/RunningAverageFilter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RunningAverageFilter.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Sachin Vas on 26/02/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// The running average algorithm takes 20 seconds worth of samples 13 | /// and ignores the top and bottom 10 percent of the RSSI readings 14 | /// and takes the mean of the remainder. 15 | 16 | /// Similar to how iOS averages samples. https://stackoverflow.com/a/37391517/3106978 17 | 18 | /// Very slow, there is a considerable lag before it moves on to the next beacon. 19 | /// Suitable for applications where the device is stationary 20 | /// 21 | 22 | internal class RunningAverageFilter: RSSIFilter { 23 | 24 | // Measurement struct used by the RunningAverageFilter 25 | internal struct Measurement: Comparable, Hashable { 26 | 27 | func hash(into hasher: inout Hasher) { 28 | hasher.combine(rssi) 29 | hasher.combine(timeStamp) 30 | } 31 | 32 | static func <(lhs: Measurement, rhs: Measurement) -> Bool { 33 | return lhs.rssi < rhs.rssi 34 | } 35 | 36 | static func ==(lhs: Measurement, rhs: Measurement) -> Bool { 37 | return lhs.rssi == rhs.rssi 38 | } 39 | 40 | var rssi: Int 41 | var timeStamp: TimeInterval 42 | } 43 | 44 | /// Stores the filter type 45 | internal var filterType: RSSIFilterType 46 | 47 | /// Filtered RSSI value 48 | internal var filteredRSSI: Int? { 49 | get { 50 | guard measurements.count > 0 else { 51 | return nil 52 | } 53 | let size = measurements.count 54 | var startIndex = measurements.startIndex 55 | var endIndex = measurements.endIndex 56 | if (size > 2) { 57 | startIndex = measurements.startIndex + measurements.index(measurements.startIndex, offsetBy: size / 10 + 1) 58 | endIndex = measurements.startIndex + measurements.index(measurements.startIndex, offsetBy: size - size / 10 - 2) 59 | } 60 | 61 | var sum = 0.0 62 | for i in startIndex.. $1 }) 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp.xcodeproj/xcshareddata/xcschemes/BeaconstacSampleApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/EddystoneRFC/Models/Telemetry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Telemetry.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 14/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// Struct that handles the beacon telemtry data 13 | /// Specs https://github.com/google/eddystone/blob/master/eddystone-tlm/tlm-plain.md 14 | /// 15 | @objc public class Telemetry: NSObject { 16 | 17 | /// Telemetry data version 18 | @objc public let version: String 19 | 20 | /// Battery voltage is the current battery charge in millivolts 21 | @objc public var voltage: UInt = 0 22 | 23 | /// Beacon temperature is the temperature in degrees Celsius sensed by the beacon. If not supported the value will be -128. 24 | @objc public var temperature: Float = 0 25 | 26 | /// ADV_CNT is the running count of advertisement frames of all types emitted by the beacon since power-up or reboot, useful for monitoring performance metrics that scale per broadcast frame 27 | @objc public var advCount: UInt = 0 28 | 29 | /// SEC_CNT is a 0.1 second resolution counter that represents time since beacon power-up or reboot 30 | @objc public var uptime: Float = 0 31 | 32 | /// Calculates the advertising interval of the beacon in milliseconds 33 | /// Assumes the beacon is transmitting all 3 eddystone packets (UID, URL and TLM frames) 34 | @objc public var advInt: Float { 35 | guard uptime != 0, uptime != 0 else { 36 | return 0 37 | } 38 | 39 | let numberOFFramesPerBeacon = 3 40 | return Float(numberOFFramesPerBeacon * 1000) / (Float(advCount) / uptime) 41 | } 42 | 43 | /// Battery percentage 44 | /// Assume the chip requires a 3V battery. Most of the beacons have Nordic chips which support 3V 45 | /// We aaume here that the lower bound is 2000 and upper bound is 3000 46 | /// If the milliVolt is less than 2000, we assume 0% and if it is greater than 3000 we consider it as 100% charged. 47 | /// The formula is % = (read milliVolt - LowerBound) / (UpperBound - LowerBound) * 100 48 | @objc public var batteryPercentage: UInt { 49 | guard voltage > 2000 else { 50 | return 0 51 | } 52 | 53 | guard voltage < 3000 else { 54 | return 100 55 | } 56 | 57 | let percentage: UInt = UInt(((Float(voltage) - 2000.0) / 1000.0) * 100.0) 58 | return percentage > 100 ? 100 : percentage 59 | } 60 | 61 | internal init?(tlmFrameData: Data) { 62 | guard let frameBytes = Telemetry.validateTLMFrameData(tlmFrameData: tlmFrameData) else { 63 | debugPrint("Failed to iniatialize the telemtry object") 64 | return nil 65 | } 66 | 67 | self.version = String(format: "%02X", frameBytes[1]) 68 | super.init() 69 | 70 | self.parseTLMFrameData(frameBytes: frameBytes) 71 | } 72 | 73 | /** 74 | Update the telemetry object for the new telemtry frame data 75 | 76 | - Parameter tlmFrameData: The raw TLM frame data 77 | */ 78 | internal func update(tlmFrameData: Data) { 79 | guard let frameBytes = Telemetry.validateTLMFrameData(tlmFrameData: tlmFrameData) else { 80 | debugPrint("Failed to update telemetry data") 81 | return 82 | } 83 | self.parseTLMFrameData(frameBytes: frameBytes) 84 | } 85 | 86 | /** 87 | Validate the TLM frame data 88 | 89 | - Parameter tlmFrameData: The raw TLM frame data 90 | */ 91 | private static func validateTLMFrameData(tlmFrameData: Data) -> [UInt8]? { 92 | let frameBytes = Array(tlmFrameData) as [UInt8] 93 | 94 | // The length of the frame should be 14 95 | guard frameBytes.count == 14 else { 96 | debugPrint("Corrupted telemetry frame") 97 | return nil 98 | } 99 | return frameBytes 100 | } 101 | 102 | /** 103 | Parse the TLM frame data 104 | 105 | - Parameter frameBytes: The `UInt8` byte array 106 | */ 107 | private func parseTLMFrameData(frameBytes: [UInt8]) { 108 | self.voltage = bytesToUInt(byteArray: frameBytes[2..<4])! 109 | self.temperature = Float(frameBytes[4]) + Float(frameBytes[5])/256 110 | self.advCount = bytesToUInt(byteArray: frameBytes[6..<10])! 111 | self.uptime = Float(bytesToUInt(byteArray: frameBytes[10..<14])!) / 10.0 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SampleApp 4 | // 5 | // Created by Sachin Vas on 21/11/17. 6 | // Copyright © 2017 MobStac. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Beaconstac 11 | import CoreLocation 12 | 13 | class ViewController: UITableViewController { 14 | 15 | var beacons = [MBeacon]() 16 | var isShowingToast: Bool = false 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | override func didReceiveMemoryWarning() { 24 | super.didReceiveMemoryWarning() 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | override func numberOfSections(in tableView: UITableView) -> Int { 29 | return 1 30 | } 31 | 32 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 33 | return beacons.count 34 | } 35 | 36 | override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 37 | return "Beacons" 38 | } 39 | 40 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 41 | let cell = tableView.dequeueReusableCell(withIdentifier: "BeaconCell", for: indexPath) as! BeaconTableViewCell 42 | let beacon = beacons[indexPath.row] 43 | cell.name.text = beacon.name 44 | cell.major.text = "\(beacon.hardware.major)" 45 | cell.minor.text = "\(beacon.hardware.minor)" 46 | cell.uuid.text = "\(beacon.hardware.UUID)" 47 | cell.rssi.text = "\(beacon.latestRSSI)" 48 | cell.serialNumber.text = beacon.hardware.serialNumber 49 | if beacon.isCampedOn { 50 | cell.backgroundColor = UIColor.green 51 | } else { 52 | cell.backgroundColor = UIColor.white 53 | } 54 | return cell 55 | } 56 | } 57 | 58 | extension ViewController { 59 | func showToast(message : String) { 60 | let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/3, y: self.view.frame.size.height/5, width: 0, height: 0)) 61 | toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6) 62 | toastLabel.textColor = UIColor.white 63 | toastLabel.textAlignment = .center; 64 | toastLabel.text = message 65 | toastLabel.alpha = 1.0 66 | toastLabel.layer.cornerRadius = 10; 67 | toastLabel.clipsToBounds = true 68 | self.view.addSubview(toastLabel) 69 | if !isShowingToast { 70 | isShowingToast = true 71 | UIView.animate(withDuration: 2.0, delay: 0, options: .curveEaseOut, animations: { 72 | toastLabel.alpha = 0.0 73 | }, completion: {[weak self] (isCompleted) in 74 | toastLabel.removeFromSuperview() 75 | self?.isShowingToast = false 76 | }) 77 | } else { 78 | DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: {[weak self] in 79 | self?.showToast(message: message) 80 | }) 81 | } 82 | } 83 | } 84 | 85 | extension ViewController: BeaconDelegate { 86 | func didFail(_ beaconstac: Beaconstac, error: Error) { 87 | print(error) 88 | } 89 | 90 | func didEnterRegion(_ beaconstac: Beaconstac, region: String) { 91 | showToast(message: "Region Entered \(region)") 92 | } 93 | 94 | func didRangeBeacons(_ beaconstac: Beaconstac, beacons: [MBeacon]) { 95 | self.beacons = beacons 96 | tableView.reloadData() 97 | } 98 | 99 | func campOnBeacon(_ beaconstac: Beaconstac, beacon: MBeacon) { 100 | tableView.reloadData() 101 | showToast(message: "Camped On \(beacon.name)") 102 | } 103 | 104 | func exitBeacon(_ beaconstac: Beaconstac, beacon: MBeacon) { 105 | tableView.reloadData() 106 | showToast(message: "Exit \(beacon.name)") 107 | } 108 | 109 | func didExitRegion(_ beaconstac: Beaconstac, region: String) { 110 | tableView.reloadData() 111 | showToast(message: "Region Exited \(region)") 112 | } 113 | } 114 | 115 | extension ViewController: RuleProcessorDelegate { 116 | 117 | func willTriggerRule(_ beaconstac: Beaconstac, rule: MRule) { 118 | // Check which rule is going to be triggred.. 119 | } 120 | 121 | func didTriggerRule(_ beaconstac: Beaconstac, rule: MRule) { 122 | // Check which rule is triggred.. 123 | } 124 | } 125 | 126 | //extension ViewController: NotificationDelegate { 127 | // func overrideNotification(_ beaconstac: Beaconstac, notification: MNotification) { 128 | // // Override the notification. 129 | // } 130 | //} 131 | 132 | extension ViewController: WebhookDelegate { 133 | func addParameters(_ beaconstac: Beaconstac, webhook: MWebhook) -> Dictionary { 134 | // retrun your values... 135 | return [:] 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/EddystoneRFC/Eddystone.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EddystoneHelper.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 28/11/17. 6 | // Copyright © 2017 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreBluetooth 11 | 12 | /** 13 | BLE frame type. 14 | 15 | - unknown: Unknown frame. 16 | - uid: UID frame. 17 | - telemetry: Telemetry frame. 18 | - eid: EID frame. 19 | - url: URL frame. 20 | */ 21 | internal enum EddystoneFrameType { 22 | case unknown, uid, telemetry, eid, url 23 | } 24 | 25 | /// Class containing static functions with Eddystone helper class methods 26 | final internal class Eddystone { 27 | 28 | static let EddystoneUIDFrameTypeID: UInt8 = 0x00 29 | static let EddystoneURLFrameTypeID: UInt8 = 0x10 30 | static let EddystoneTLMFrameTypeID: UInt8 = 0x20 31 | static let EddystoneEIDFrameTypeID: UInt8 = 0x30 32 | static let ServiceUUID: CBUUID = CBUUID(string: "FEAA") 33 | 34 | /** 35 | Get Frametype from the adverstiment data of a BLE device. 36 | 37 | - Parameter advertisementFrameList: The framelist returned from the CBCentralManager didDiscoverPerfipheral 38 | */ 39 | final internal class func frameTypeForFrame(advertisementFrameList: [NSObject : AnyObject]) -> EddystoneFrameType { 40 | guard let frameData = advertisementFrameList[Eddystone.ServiceUUID] as? Data, frameData.count > 1 else { 41 | return .unknown 42 | } 43 | 44 | let frameBytes = Array(frameData) as [UInt8] 45 | 46 | let frameByte = frameBytes[0] 47 | if frameByte == Eddystone.EddystoneUIDFrameTypeID { 48 | return .uid 49 | } else if frameByte == Eddystone.EddystoneTLMFrameTypeID { 50 | return .telemetry 51 | } else if frameByte == Eddystone.EddystoneEIDFrameTypeID { 52 | return .eid 53 | } else if frameByte == Eddystone.EddystoneURLFrameTypeID { 54 | return .url 55 | } 56 | return .unknown 57 | } 58 | 59 | /** 60 | Returns telemetry data braodcasted by the beacon. Check the frameType using `Beacon.frameTypeForFrame` as being 61 | `.telemetry` before calling this function 62 | 63 | - Parameter advertisementFrameList: The framelist returned from the CBCentralManager didDiscoverPerfipheral 64 | */ 65 | final internal class func telemetryDataForFrame(advertisementFrameList: [NSObject : AnyObject]) -> Data? { 66 | return advertisementFrameList[Eddystone.ServiceUUID] as? Data 67 | } 68 | 69 | /** 70 | Returns the eddystone URL braodcasted by the beacon. Check the frameType using `Beacon.frameTypeForFrame` as being 71 | `.url` before calling this function 72 | 73 | - Parameter frameData: The frame data returned from the CBCentralManager didDiscoverPeripheral 74 | */ 75 | final internal class func parseURLFromFrame(advertisementFrameList: [NSObject : AnyObject]) -> URL? { 76 | guard let frameData = advertisementFrameList[Eddystone.ServiceUUID] as? Data, frameData.count > 1 else { 77 | return nil 78 | } 79 | 80 | let frameBytes = Array(frameData) as [UInt8] 81 | guard let URLPrefix = URLPrefixFromByte(schemeID: frameBytes[2]) else { 82 | return nil 83 | } 84 | 85 | var output = URLPrefix 86 | for i in 3.. String? { 96 | switch schemeID { 97 | case 0x00: 98 | return "http://www." 99 | case 0x01: 100 | return "https://www." 101 | case 0x02: 102 | return "http://" 103 | case 0x03: 104 | return "https://" 105 | default: 106 | return nil 107 | } 108 | } 109 | 110 | private class func encodedStringFromByte(charVal: UInt8) -> String? { 111 | switch charVal { 112 | case 0x00: 113 | return ".com/" 114 | case 0x01: 115 | return ".org/" 116 | case 0x02: 117 | return ".edu/" 118 | case 0x03: 119 | return ".net/" 120 | case 0x04: 121 | return ".info/" 122 | case 0x05: 123 | return ".biz/" 124 | case 0x06: 125 | return ".gov/" 126 | case 0x07: 127 | return ".com" 128 | case 0x08: 129 | return ".org" 130 | case 0x09: 131 | return ".edu" 132 | case 0x0a: 133 | return ".net" 134 | case 0x0b: 135 | return ".info" 136 | case 0x0c: 137 | return ".biz" 138 | case 0x0d: 139 | return ".gov" 140 | default: 141 | return String(data: Data([charVal]), encoding: .utf8) 142 | } 143 | } 144 | 145 | 146 | } 147 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/SafeSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SafeSet.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 11/01/18. 6 | // Copyright © 2018 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// 12 | /// Safe Set 13 | /// 14 | /// Thread safe generic set class in swift 15 | /// Methods and properties are similar to that of the generic Set class 16 | /// Example: let a = SafeSet(identifier: "a") 17 | /// 18 | public class SafeSet { 19 | private let queue: DispatchQueue 20 | private var set: Set = [] 21 | var index: Set.Index 22 | 23 | public init(identifier: String) { 24 | queue = DispatchQueue(label: "com.safeset.\(Date().timeIntervalSince1970).\(identifier)", attributes: .concurrent) 25 | index = set.startIndex 26 | } 27 | 28 | public subscript(index: Set.Index) -> E? { 29 | get { 30 | return queue.sync { 31 | guard index < set.endIndex else { 32 | return nil 33 | } 34 | return set[index] 35 | } 36 | } 37 | } 38 | } 39 | 40 | extension SafeSet { 41 | // MARK: Mutable methods 42 | public func insert(_ newMember: E) { 43 | queue.async(flags: .barrier) { 44 | self.set.insert(newMember) 45 | } 46 | } 47 | 48 | public func remove(_ member: E) { 49 | queue.async(flags: .barrier) { 50 | self.set.remove(member) 51 | } 52 | } 53 | 54 | public func update(with member: E) { 55 | queue.async(flags: .barrier) { 56 | let _ = self.set.update(with: member) 57 | } 58 | } 59 | 60 | public func filterInPlace(_ isIncluded: @escaping (E) -> Bool) { 61 | queue.async(flags: .barrier) { 62 | let originalSet = self.set 63 | self.set = Set() 64 | 65 | for member in originalSet { 66 | if isIncluded(member) { 67 | self.set.insert(member) 68 | } 69 | } 70 | } 71 | } 72 | 73 | public func removeAll() { 74 | queue.async(flags: .barrier) { 75 | self.set.removeAll() 76 | } 77 | } 78 | 79 | public func subtract(_ other: SafeSet) { 80 | queue.async(flags: .barrier) { 81 | self.set = self.set.subtracting(other.set) 82 | } 83 | } 84 | 85 | public func union(_ safeSet: SafeSet) { 86 | queue.async(flags: .barrier) { 87 | for element in safeSet.getSet() { 88 | self.set.insert(element) 89 | } 90 | } 91 | } 92 | } 93 | 94 | extension SafeSet: Sequence { 95 | public func makeIterator() -> SafeSetIterator { 96 | return SafeSetIterator(Array(self.set)) 97 | } 98 | } 99 | 100 | extension SafeSet { 101 | // MARK: Immutable properties 102 | public var isEmpty: Bool { 103 | get { 104 | return queue.sync { 105 | return set.isEmpty 106 | } 107 | } 108 | } 109 | 110 | public var count: Int { 111 | get { 112 | return queue.sync { 113 | return set.count 114 | } 115 | } 116 | } 117 | 118 | public var startIndex: Set.Index { 119 | get { 120 | return queue.sync { 121 | return set.startIndex 122 | } 123 | } 124 | } 125 | 126 | public var endIndex: Set.Index { 127 | get { 128 | return queue.sync { 129 | return set.endIndex 130 | } 131 | } 132 | } 133 | 134 | // MARK: Immutable methods 135 | public func getSet() -> Set { 136 | return queue.sync { 137 | return set 138 | } 139 | } 140 | 141 | public func contains(_ member: E) -> Bool { 142 | return queue.sync { 143 | return set.contains(member) 144 | } 145 | } 146 | 147 | public func index(of member: E) -> Set.Index? { 148 | return queue.sync { 149 | return set.firstIndex(of: member) 150 | } 151 | } 152 | 153 | public func first(where predicate: (E) throws -> Bool) rethrows -> E? { 154 | return try queue.sync { 155 | return try set.first(where: predicate) 156 | } 157 | } 158 | } 159 | 160 | public struct SafeSetIterator: IteratorProtocol { 161 | 162 | private let values: [E] 163 | private var index: Int? 164 | 165 | init(_ values: [E]) { 166 | self.values = values 167 | } 168 | 169 | private func nextIndex(for index: Int?) -> Int? { 170 | if let index = index, index < self.values.count - 1 { 171 | return index + 1 172 | } 173 | if index == nil, !self.values.isEmpty { 174 | return 0 175 | } 176 | return nil 177 | } 178 | 179 | mutating public func next() -> E? { 180 | if let index = self.nextIndex(for: self.index) { 181 | self.index = index 182 | return self.values[index] 183 | } 184 | return nil 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleApp 4 | // 5 | // Created by Sachin Vas on 21/11/17. 6 | // Copyright © 2017 MobStac. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreLocation 11 | import CoreBluetooth 12 | import Beaconstac 13 | import UserNotifications 14 | 15 | @UIApplicationMain 16 | class AppDelegate: UIResponder, UIApplicationDelegate, CBCentralManagerDelegate { 17 | 18 | func centralManagerDidUpdateState(_ central: CBCentralManager) { 19 | if central.state == .poweredOn { 20 | beaconstac?.startScanningBeacons() 21 | } else { 22 | beaconstac?.stopScanningBeacons() 23 | } 24 | } 25 | 26 | var window: UIWindow? 27 | var beaconstac: Beaconstac? 28 | var locationManager: CLLocationManager! 29 | var bluetoothManager: CBCentralManager! 30 | 31 | var MY_DEVELOPER_TOKEN = "08ddda7aabcbecfa54b29f6d032d7d289eb241b5" 32 | 33 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 34 | // Override point for customization after application launch. 35 | 36 | bluetoothManager = CBCentralManager(delegate: self, queue: nil, options: nil) 37 | 38 | locationManager = CLLocationManager() 39 | locationManager.delegate = self 40 | locationManager.requestAlwaysAuthorization() 41 | 42 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {[weak self] (success, error) in 43 | if success { 44 | UNUserNotificationCenter.current().delegate = self 45 | } else { 46 | print(error ?? "") 47 | } 48 | } 49 | 50 | return true 51 | } 52 | 53 | func applicationWillResignActive(_ application: UIApplication) { 54 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 55 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 56 | } 57 | 58 | func applicationDidEnterBackground(_ application: UIApplication) { 59 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 60 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 61 | } 62 | 63 | func applicationWillEnterForeground(_ application: UIApplication) { 64 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 65 | } 66 | 67 | func applicationDidBecomeActive(_ application: UIApplication) { 68 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 69 | } 70 | 71 | func applicationWillTerminate(_ application: UIApplication) { 72 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 73 | } 74 | } 75 | 76 | extension AppDelegate: CLLocationManagerDelegate { 77 | func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { 78 | if status == .authorizedAlways || status == .authorizedWhenInUse { 79 | if beaconstac != nil { 80 | beaconstac?.startScanningBeacons() 81 | } else { 82 | if let viewController = (self.window?.rootViewController as? UINavigationController)?.topViewController as? ViewController { 83 | Beaconstac.sharedInstance(MY_DEVELOPER_TOKEN, delegate: viewController, completion: {[weak self] (beaconstacInstance, error) in 84 | if let instance = beaconstacInstance { 85 | self?.beaconstac = instance 86 | self?.beaconstac?.startScanningBeacons() 87 | // self?.beaconstac?.notificationDelegate = viewController 88 | self?.beaconstac?.webhookDelegate = viewController 89 | self?.beaconstac?.ruleDelegate = viewController 90 | } 91 | }) 92 | } 93 | } 94 | } else { 95 | beaconstac?.stopScanningBeacons() 96 | } 97 | } 98 | } 99 | 100 | extension AppDelegate: UNUserNotificationCenterDelegate { 101 | 102 | func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { 103 | var notificationPresentationOptions: UNNotificationPresentationOptions 104 | if beaconstac != nil { 105 | if let notificationOption = beaconstac?.notificationOptionsForBeaconstacNotification(notification), notificationOption.rawValue > 0 { 106 | notificationPresentationOptions = notificationOption 107 | } else { 108 | // Your configuration... 109 | notificationPresentationOptions = .sound 110 | } 111 | completionHandler(notificationPresentationOptions) 112 | } 113 | } 114 | 115 | func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { 116 | let notification = response.notification 117 | if let instance = beaconstac, instance.showCardViewerForLocalNotification(notification) { 118 | // We will handle the notification... 119 | } else { 120 | // Leave it to us... 121 | } 122 | completionHandler() 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/BeaconTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 34 | 40 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/EddystoneRFC/Models/Beacon.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Beacon.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 27/11/17. 6 | // Copyright © 2017 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreBluetooth 11 | 12 | /// Main Beacon class 13 | @objc public class Beacon: NSObject { 14 | 15 | /// Beacon name as found in the CBPeriferal object 16 | @objc public let name: String? 17 | 18 | /// UUID identifier of the beacon 19 | @objc public let identifier: UUID 20 | 21 | /// BeaconID - unique for each beacon as per Eddystone RFC 22 | @objc public let beaconID: BeaconID 23 | 24 | /// Transmission power of the beacon 25 | @objc public let txPower: Int 26 | 27 | /// RSSI value of the beacon. Can be used to determine how far away the beacon is from the device 28 | @objc public var rssi: Int 29 | 30 | /// Timestamp when the device recieved a packet from the beacon. 31 | /// Can be any one of URL, UID/EID or the TLM frames 32 | @objc public var lastSeen: Date = Date() 33 | 34 | /// Eddystone URL being broadcasted by the beacon 35 | @objc public var eddystoneURL: URL? 36 | 37 | /// Filtered RSSI value based on the filter type specified 38 | @objc public var filteredRSSI: Int { 39 | get { 40 | return self.filter.filteredRSSI ?? 0 41 | } 42 | } 43 | 44 | /// Distance of the beacon from the device 45 | @objc public var distance: Double { 46 | get { 47 | if (txPower == 0 || rssi == 0) { 48 | return -1 49 | } 50 | var dist = -1.0 51 | if (rssi == 0) { 52 | return dist // if we cannot determine accuracy, return -1. 53 | } 54 | let ratio = Double(rssi) * 1.0 / Double(txPower) 55 | if (ratio < 1.0) { 56 | dist = pow(ratio, 10) 57 | } else { 58 | dist = (0.89976) * pow(ratio, 7.7095) + 0.111 59 | } 60 | return dist 61 | } 62 | } 63 | 64 | /// Telemtry data from the beacon. Always updated to the latest value 65 | @objc public var telemetry: Telemetry? 66 | 67 | /// Kalman filter 68 | private let filter: RSSIFilter 69 | 70 | private init(identifier: UUID, 71 | beaconID: BeaconID, 72 | txPower: Int, 73 | rssi: Int, 74 | name: String?, 75 | filterType: RSSIFilterType) { 76 | self.name = name 77 | self.identifier = identifier 78 | self.beaconID = beaconID 79 | self.txPower = txPower 80 | self.rssi = rssi 81 | 82 | if filterType == .arma { 83 | self.filter = ArmaFilter() 84 | } else if filterType == .kalman { 85 | self.filter = KalmanFilter() 86 | } else if filterType == .gaussian { 87 | self.filter = GaussianFilter() 88 | } else { 89 | self.filter = RunningAverageFilter() 90 | } 91 | 92 | super.init() 93 | } 94 | 95 | /** 96 | Failable convinience initialiser to create a Beacon object with Eddystone UID/EID packet 97 | 98 | - Parameter frameData: The frameData. 99 | - Parameter telemetry: The telemetry data obtained from Beacon.telemetryDataForFrame. Optional. 100 | - Parameter rssi: The RSSI value of the beacon. 101 | */ 102 | convenience internal init?(identifier: UUID, 103 | frameData: Data?, 104 | rssi: Int, 105 | name: String?, 106 | namespaceFilter: String?, 107 | filterType: RSSIFilterType) { 108 | guard let frameData = frameData, frameData.count > 1 else { 109 | return nil 110 | } 111 | 112 | let frameBytes = Array(frameData) as [UInt8] 113 | 114 | let frameByte = frameBytes[0] 115 | guard (frameByte == Eddystone.EddystoneUIDFrameTypeID || 116 | frameByte == Eddystone.EddystoneEIDFrameTypeID) else { 117 | debugPrint("Unexpected non UID/EID Frame passed to the initialiser.") 118 | return nil 119 | } 120 | 121 | let txPower = Int(Int8(bitPattern:frameBytes[1])) 122 | 123 | let beaconID: BeaconID 124 | if frameByte == Eddystone.EddystoneUIDFrameTypeID { 125 | guard frameBytes.count >= 18 else { 126 | debugPrint("Frame Data for UID Frame unexpectedly truncated.") 127 | return nil 128 | } 129 | beaconID = BeaconID(beaconType: .eddystone, 130 | beaconID: Array(frameBytes[2..<18])) 131 | if let filter = namespaceFilter { 132 | if let namespace = beaconID.namespace?.hexString { 133 | if filter != namespace { 134 | return nil 135 | } 136 | } else { 137 | return nil 138 | } 139 | } 140 | } else { 141 | guard frameBytes.count >= 10 else { 142 | debugPrint("Frame Data for EID Frame unexpectedly truncated.") 143 | return nil 144 | } 145 | beaconID = BeaconID(beaconType: .eddystoneEID, 146 | beaconID: Array(frameBytes[2..<10])) 147 | } 148 | 149 | self.init(identifier: identifier, 150 | beaconID: beaconID, 151 | txPower: txPower, 152 | rssi: rssi, 153 | name: name, 154 | filterType: filterType) 155 | } 156 | 157 | /** 158 | Update the beacon object with changable data 159 | 160 | - Parameter telemetryData: Telemetry Data from the beacon. 161 | - Parameter eddystoneURL: The eddystoneURL of the beacon. 162 | - Parameter rssi: The current RSSI value of the beacon. 163 | */ 164 | internal func updateBeacon(telemetryData: Data?, eddystoneURL: URL?, rssi: Int) { 165 | self.rssi = rssi 166 | self.filter.calculate(forRSSI: rssi) 167 | self.lastSeen = Date() 168 | 169 | if let eddystoneURL = eddystoneURL { 170 | self.eddystoneURL = eddystoneURL 171 | } 172 | 173 | guard let telemetryData = telemetryData else { 174 | return 175 | } 176 | 177 | // Check if the beacon already has a telemtry data object 178 | if let _ = self.telemetry { 179 | self.telemetry?.update(tlmFrameData: telemetryData) 180 | } else { 181 | // Create a new object 182 | self.telemetry = Telemetry(tlmFrameData: telemetryData) 183 | } 184 | } 185 | } 186 | 187 | extension Beacon { 188 | // MARK: CustomStringConvertible protocol requirements 189 | override public var description: String { 190 | return self.beaconID.description 191 | } 192 | } 193 | 194 | extension Beacon { 195 | // MARK: Equatable protocol requirements 196 | public static func == (lhs: Beacon, rhs: Beacon) -> Bool { 197 | return lhs.beaconID == rhs.beaconID 198 | } 199 | } 200 | 201 | extension Beacon { 202 | // MARK: Hashable protocol requirements 203 | override public var hash: Int { 204 | get { 205 | return self.description.hash 206 | } 207 | } 208 | } 209 | 210 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v3.2.10 released on December 2, 2021 2 | * Xcode 13.1 3 | 4 | ### v3.2.9 released on June 26, 2020 5 | * Xcode 12.4 6 | 7 | 8 | ### v3.2.8 released on June 26, 2020 9 | * Swift 5.2.4 10 | 11 | 12 | ### v3.2.7 released on March 18, 2020 13 | * Remove iPhoneSimulator from Info.plist 14 | 15 | ### v3.2.6 released on January 28, 2020 16 | * Xcode 11 17 | 18 | ### v3.2.5 released on April 8, 2019 19 | * Swift 5.0 20 | 21 | ### v3.2.2 released on December 6, 2018 22 | * Fix Merge Conflicts 23 | 24 | ### v3.2.1 released on Novermber 29, 2018 25 | 26 | * Fix NSBatchDeleteRequest 27 | * Fix NSFetchRequest Crash 28 | 29 | ### v3.2 released on September 21, 2018 30 | 31 | * Swift 4.2 32 | 33 | ### v3.1.8 released on September 11, 2018 34 | 35 | * Minor Bug Fix 36 | 37 | ### v3.1.7 released on July 10, 2018 38 | 39 | * Update Swift Version in Podspec to 4.1 40 | 41 | ### v3.1.6 released on July 10, 2018 42 | 43 | * Fix offline crashes 44 | 45 | ### v3.1.5 released on April 6, 2018 46 | 47 | * Fix threading issues 48 | 49 | ### v3.1.4 released on April 4, 2018 50 | 51 | * Fix bug around mandatory non-exsistent property. 52 | 53 | ### v3.1.3 release on March 27, 2018 54 | 55 | * Remove Proximity Status from the server 56 | 57 | ### v3.1.2 released on March 21, 2018 58 | 59 | * Fix Visitor Entity 60 | 61 | ### v3.1.1 released on March 16, 2018 62 | 63 | * Expose REGION_IDENTIFIER of CLBeaconRegion 64 | * Update EddystoneScanner 65 | 66 | ### v3.1 released on March 5, 2018 67 | 68 | * Analytics overhaul changes 69 | * Define LATCH_LATENCY for campOn/campOff behaviour 70 | 71 | ### v3.0.1 released on December 14, 2017 72 | 73 | * Event Logging changes. 74 | * Fix defnition of `BeaconDelegate`'s didRagneBeacons to return `MBeacon` objects. 75 | * Fix method signature. 76 | 77 | ### v3.0 released on Decemeber 14, 2017 78 | * Introducing a completely new Beaconstac SDK written completely in Swift. 79 | * One line initialisation making it easier than ever to integrate Beaconstac into your app. 80 | * Light-weight and added bitcode support. 81 | * A new way to handle location permission for battery efficient BLE scanning and conforming to Apple App Store guidelines. 82 | * Uses the much improved Beaconstac API v2 for faster and intelligent syncing of rules. 83 | * Offline support with persistent caching of rules. 84 | 85 | ### v1.5.3 released on February 13, 2017 86 | 87 | * Introducing beacon ranging on display wakeup. 88 | * Added a new property usageRequirement in Beaconstac.h to better manage user location permissions based on the applications requirement. 89 | * Removed allowRangingInBackground property from Beaconstac.h. Instead use the property usageRequirement for setting your applications options. 90 | * Added a new MSNotification property in MSCard to display notification attached to the card. 91 | 92 | ### v1.5.2 released on October 4, 2016 93 | 94 | * Fixed a bug which was causing crash on iOS 10. 95 | 96 | ### v1.5.1 released on July 20, 2016 97 | 98 | * Improvements in user analytics. This update is recommended for all users. 99 | 100 | 101 | ### v1.5 released on July 8, 2016 102 | 103 | * Introducing Rules by Places. This allows assigning a MSRule to a MSPlace object instead of a single MSBeacon or a MSTag on beacons. Check Beaconstac Admin Console on how to set it up. 104 | * Added a new property for assigning GooglePlaceID to a given MSPlace object. 105 | * Added a new property in MSRule - placesBeacons, which is an array of beacons attached to a place in case this MSRule is assigned to a MSPlace. 106 | * SDK automatically syncs notifications from Beaconstac Admin Conole and registers UserNotificationCategory for each CTA created under Notifications. 107 | 108 | ### v1.4.2 released on April 5, 2016 109 | 110 | * Fixed a bug which was causing Custom attributes to not work properly. 111 | 112 | ### v1.4.1 released on March 17, 2016 113 | 114 | * Fixed a bug which was causing name and email to be not reported on Analytics dashboard (https://manage.beaconstac.com/reporting/visitors) 115 | * Introduced new property in Beaconstac to check if beacon ranging is enabled 116 | * Introduced new api in MSRuleProcessor to fetch rules from server, ignoring the local cached version 117 | * MSRuleProcessor cannot be accessed as [MSRuleProcessor sharedInstance] anymore. Instead, use the property in Beaconstac instance: [[Beaconstac sharedInstance] ruleProcessor] 118 | 119 | 120 | ### v1.4 released on February 8, 2016 121 | 122 | * New classes for Webpage, Custom and Popup action types. All action types now inherit from MSAction. Check the Example code for how to access these. 123 | * Improvement in 'allowRangingInBackground' property 124 | 125 | ### v1.3.2 released on January 21, 2016 126 | 127 | * New Webhook class and delegate methods. See the updated Admin Console for including Webhook parameters. 128 | * Example app updated to include Summary Card and Photo Card UI 129 | 130 | ### v1.3.1 released on January 7, 2016 131 | 132 | * Fixed issues with geo-fence monitoring for reliable sync when changes are made on the admin console 133 | 134 | ### v1.3 released on December 17, 2015 135 | 136 | * Added support for syncing and showing notifications associated with cards or created as a standalone action 137 | * Added a method to enable/disable background ranging 138 | 139 | ### v1.2 released on December 9, 2015 140 | 141 | * Added compatibility for background beacon ranging on iOS9 142 | * Added a new delegate method which is triggered when Rule sync with server completes 143 | * Performance improvement in rule triggering 144 | * Cleanup all data on destroying Beaconstac shared instance 145 | 146 | ### v1.1.1 released on August 12, 2015 147 | 148 | * Rules assigned to Tags will trigger callbacks when camped on the tagged beacon 149 | * Added a property in MSBeaconManager to get the currently campedOnBeacon 150 | * Fixed a bug which prevented Exit Rules to not trigger if there were multiple Exit Rules on same beacon 151 | 152 | ### v1.1 released on August 4, 2015 153 | 154 | * Added MSTags class to enable grouping beacons by tags 155 | * Start/Stop Geo-fence api changed 156 | * Added delegate callback if SDK fails to sync rule with the server 157 | * Shows error in Console if an invalid UUID is entered 158 | 159 | ### v1.0 released on June 4, 2015 160 | 161 | * Added MSPlace class to enable grouping beacons by places 162 | * Ability to add Geo-fences around MSPlace with entry/exit callbacks 163 | * Version number dropped from framework name 164 | 165 | ### v0.9.16 released on April 29, 2015 166 | 167 | * Added ability to track sessions based on change in time and location 168 | 169 | ### v0.9.15 released on April 27, 2015 170 | 171 | * Added ability to reset a Beaconstac sharedInstance in case of switching user accounts 172 | 173 | ### v0.9.14 released on Apr 15, 2015 174 | 175 | * Rule processor Action type webhook - webhook parameters now contain more contextual information 176 | 177 | ### v0.9.13 released on Apr 9, 2015 178 | 179 | * Delegate method names updated to include sender object as the first parameter in Beaconstac, MSBeaconManager and MSRuleProcessor classes 180 | * Added more fields to event log packet like campon duration on a beacon 181 | * Added a description property to MSBeacon class 182 | * Major improvement in beacon campon and exit behavior 183 | * Minor bug fixes and improvements 184 | 185 | ### v0.9.12 released on Feb 9, 2015 186 | 187 | * Added more fields to event logger 188 | * Added support for Beaconstac delegates to be optional 189 | * Major bug fix - First time beacon detection bug fixed 190 | * Minor bug fixes 191 | 192 | ### v0.9.11 released on Jan 7, 2014 193 | 194 | * Added GET, POST, PUT, DELETE methods to MSNetwork class 195 | * Deprecated postToServer and fetchDataForURL methods in MSNetwork class 196 | * Added MSUIAction enum for action type in MSAnalytics. Deprecated MSActionType in MSAnalytics 197 | * Added created, modified and status properties to MSAction class 198 | * Added MSCard and MSMedia classes to Beaconstac for handling card action type and media in card action type 199 | * Fixed bug - Ranging and monitoring beacons specific to region 200 | * Fixed bug - Removed ambiguity with class name for Reachability.h 201 | * Fixed bug - webhook action type post parameters 202 | * Fixed bug - Added Dwell time implementation to exit beacon event 203 | 204 | ### v0.9.10 released on Dec 18, 2014 205 | 206 | * Added sharedInstanceWithOrganizationId: developerToken method for creating a Beaconstac shared instance 207 | * Added method for start ranging beacons with UUID and identifier in Beaconstac and MSBeaconManager classes 208 | * Added support for filter options while ranging beacons 209 | * Added method for stopping beacon ranging in Beaconstac and MSBeaconManager classes 210 | * Added support for triggering rules based on exit beacon event 211 | * Deprecated setUpOrganizationId: userToken: beaconUUID: beaconIdentifier method from Beaconstac class 212 | * Deprecated sharedInstance method in Beaconstac class 213 | * Modified initUserIdentity method to setUserIdentity in Beaconstac class 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/Target Support Files/Pods-BeaconstacSampleApp/Pods-BeaconstacSampleApp-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | BCSYMBOLMAP_DIR="BCSymbolMaps" 23 | 24 | 25 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 26 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 27 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 28 | 29 | # Copies and strips a vendored framework 30 | install_framework() 31 | { 32 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 33 | local source="${BUILT_PRODUCTS_DIR}/$1" 34 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 35 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 36 | elif [ -r "$1" ]; then 37 | local source="$1" 38 | fi 39 | 40 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 41 | 42 | if [ -L "${source}" ]; then 43 | echo "Symlinked..." 44 | source="$(readlink "${source}")" 45 | fi 46 | 47 | if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then 48 | # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied 49 | find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do 50 | echo "Installing $f" 51 | install_bcsymbolmap "$f" "$destination" 52 | rm "$f" 53 | done 54 | rmdir "${source}/${BCSYMBOLMAP_DIR}" 55 | fi 56 | 57 | # Use filter instead of exclude so missing patterns don't throw errors. 58 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 59 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 60 | 61 | local basename 62 | basename="$(basename -s .framework "$1")" 63 | binary="${destination}/${basename}.framework/${basename}" 64 | 65 | if ! [ -r "$binary" ]; then 66 | binary="${destination}/${basename}" 67 | elif [ -L "${binary}" ]; then 68 | echo "Destination binary is symlinked..." 69 | dirname="$(dirname "${binary}")" 70 | binary="${dirname}/$(readlink "${binary}")" 71 | fi 72 | 73 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 74 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 75 | strip_invalid_archs "$binary" 76 | fi 77 | 78 | # Resign the code if required by the build settings to avoid unstable apps 79 | code_sign_if_enabled "${destination}/$(basename "$1")" 80 | 81 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 82 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 83 | local swift_runtime_libs 84 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 85 | for lib in $swift_runtime_libs; do 86 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 87 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 88 | code_sign_if_enabled "${destination}/${lib}" 89 | done 90 | fi 91 | } 92 | # Copies and strips a vendored dSYM 93 | install_dsym() { 94 | local source="$1" 95 | warn_missing_arch=${2:-true} 96 | if [ -r "$source" ]; then 97 | # Copy the dSYM into the targets temp dir. 98 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 99 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 100 | 101 | local basename 102 | basename="$(basename -s .dSYM "$source")" 103 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 104 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 105 | 106 | # Strip invalid architectures from the dSYM. 107 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 108 | strip_invalid_archs "$binary" "$warn_missing_arch" 109 | fi 110 | if [[ $STRIP_BINARY_RETVAL == 0 ]]; then 111 | # Move the stripped file into its final destination. 112 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 113 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 114 | else 115 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 116 | mkdir -p "${DWARF_DSYM_FOLDER_PATH}" 117 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 118 | fi 119 | fi 120 | } 121 | 122 | # Used as a return value for each invocation of `strip_invalid_archs` function. 123 | STRIP_BINARY_RETVAL=0 124 | 125 | # Strip invalid architectures 126 | strip_invalid_archs() { 127 | binary="$1" 128 | warn_missing_arch=${2:-true} 129 | # Get architectures for current target binary 130 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 131 | # Intersect them with the architectures we are building for 132 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 133 | # If there are no archs supported by this binary then warn the user 134 | if [[ -z "$intersected_archs" ]]; then 135 | if [[ "$warn_missing_arch" == "true" ]]; then 136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 137 | fi 138 | STRIP_BINARY_RETVAL=1 139 | return 140 | fi 141 | stripped="" 142 | for arch in $binary_archs; do 143 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 144 | # Strip non-valid architectures in-place 145 | lipo -remove "$arch" -output "$binary" "$binary" 146 | stripped="$stripped $arch" 147 | fi 148 | done 149 | if [[ "$stripped" ]]; then 150 | echo "Stripped $binary of architectures:$stripped" 151 | fi 152 | STRIP_BINARY_RETVAL=0 153 | } 154 | 155 | # Copies the bcsymbolmap files of a vendored framework 156 | install_bcsymbolmap() { 157 | local bcsymbolmap_path="$1" 158 | local destination="${BUILT_PRODUCTS_DIR}" 159 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 160 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 161 | } 162 | 163 | # Signs a framework with the provided identity 164 | code_sign_if_enabled() { 165 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 166 | # Use the current code_sign_identity 167 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 168 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 169 | 170 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 171 | code_sign_cmd="$code_sign_cmd &" 172 | fi 173 | echo "$code_sign_cmd" 174 | eval "$code_sign_cmd" 175 | fi 176 | } 177 | 178 | if [[ "$CONFIGURATION" == "Debug" ]]; then 179 | install_framework "${BUILT_PRODUCTS_DIR}/EddystoneScanner/EddystoneScanner.framework" 180 | fi 181 | if [[ "$CONFIGURATION" == "Release" ]]; then 182 | install_framework "${BUILT_PRODUCTS_DIR}/EddystoneScanner/EddystoneScanner.framework" 183 | fi 184 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 185 | wait 186 | fi 187 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/Pods/EddystoneScanner/EddystoneScanner/Scanner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Scanner.swift 3 | // EddystoneScanner 4 | // 5 | // Created by Amit Prabhu on 27/11/17. 6 | // Copyright © 2017 Amit Prabhu. All rights reserved. 7 | // 8 | 9 | import CoreBluetooth 10 | 11 | @objc public enum State: Int { 12 | case unknown 13 | case off 14 | case on 15 | } 16 | 17 | /// 18 | /// ScannerDelegate 19 | /// 20 | /// Implement this to receive notifications about beacons discovered in proximity. 21 | @objc public protocol ScannerDelegate { 22 | @objc func didFindBeacon(scanner: Scanner, beacon: Beacon) 23 | @objc func didLoseBeacon(scanner: Scanner, beacon: Beacon) 24 | @objc func didUpdateBeacon(scanner: Scanner, beacon: Beacon) 25 | @objc func didUpdateScannerState(scanner: Scanner, state: State) 26 | } 27 | 28 | /// 29 | /// Scanner 30 | /// 31 | /// Scans for Eddystone compliant beacons using Core Bluetooth. To receive notifications of any 32 | /// sighted beacons, be sure to implement BeaconScannerDelegate and set that on the scanner. 33 | /// 34 | @objc public class Scanner: NSObject { 35 | 36 | /// Scanner Delegate 37 | @objc public var delegate: ScannerDelegate? 38 | 39 | /// Namespace Filter 40 | @objc public var namespaceFilter: String? = nil 41 | 42 | /// Beacons that are close to the device. 43 | /// Keeps getting updated. Beacons are removed periodically when no packets are recieved in a 10 second interval 44 | public var nearbyBeacons = SafeSet(identifier: "nearbyBeacons") 45 | 46 | /// RSSI Filter type used 47 | @objc public let rssiFilterType: RSSIFilterType 48 | 49 | private var centralManager: CBCentralManager! 50 | private let beaconOperationsQueue: DispatchQueue = DispatchQueue(label: Constants.BEACON_OPERATION_QUEUE_LABEL) 51 | private var shouldBeScanning: Bool = false 52 | 53 | /// Timer to remove beacons not in the the apps proximity 54 | private var timer: DispatchTimer? 55 | 56 | private var state: State = .unknown { 57 | willSet { 58 | delegate?.didUpdateScannerState(scanner: self, state: newValue) 59 | } 60 | } 61 | 62 | // MARK: Public functions 63 | /// Initialises the CBCentralManager for scanning and the DispatchTimer 64 | public init(rssiFilterType: RSSIFilterType = .arma) { 65 | self.rssiFilterType = rssiFilterType 66 | super.init() 67 | 68 | self.centralManager = CBCentralManager(delegate: self, queue: self.beaconOperationsQueue) 69 | self.timer = DispatchTimer(repeatingInterval: 10.0, queueLabel: Constants.DISPATCH_TIMER_QUEUE_LABEL) 70 | self.timer?.delegate = self 71 | } 72 | 73 | /// 74 | /// Start scanning. If Core Bluetooth isn't ready for us just yet, then waits and THEN starts scanning 75 | /// 76 | @objc public func startScanning() { 77 | guard centralManager.state == .poweredOn else { 78 | state = .off 79 | shouldBeScanning = true 80 | debugPrint("CentralManager state is %d, cannot start scan", centralManager.state.rawValue) 81 | return 82 | } 83 | if !shouldBeScanning { 84 | shouldBeScanning = true 85 | state = .on 86 | startScanningSynchronized() 87 | timer?.startTimer() 88 | } 89 | } 90 | 91 | /// 92 | /// Stops scanning for beacons 93 | /// 94 | @objc public func stopScanning() { 95 | if shouldBeScanning { 96 | shouldBeScanning = false 97 | centralManager.stopScan() 98 | timer?.stopTimer() 99 | DispatchQueue.main.async { 100 | for beacon in self.nearbyBeacons.getSet() { 101 | self.delegate?.didLoseBeacon(scanner: self, beacon: beacon) 102 | } 103 | self.nearbyBeacons.removeAll() 104 | } 105 | } 106 | } 107 | 108 | 109 | // MARK: Private functions 110 | /// 111 | /// Starts scanning for beacons 112 | /// 113 | private func startScanningSynchronized() { 114 | debugPrint("Starting scan for Eddystone beacons") 115 | let services = [CBUUID(string: "FEAA")] 116 | let options = [CBCentralManagerScanOptionAllowDuplicatesKey : true] 117 | self.centralManager.scanForPeripherals(withServices: services, options: options) 118 | } 119 | } 120 | 121 | extension Scanner: CBCentralManagerDelegate { 122 | // MARK: CBCentralManagerDelegate callbacks 123 | public func centralManagerDidUpdateState(_ central: CBCentralManager) { 124 | var state = State.unknown 125 | switch central.state { 126 | case .poweredOff: 127 | state = .off 128 | case .poweredOn: 129 | state = .on 130 | // Handle state changes and user requirement 131 | if shouldBeScanning && !central.isScanning { 132 | shouldBeScanning = false 133 | startScanning() 134 | } 135 | case .unauthorized: 136 | state = .off 137 | default: 138 | state = .unknown 139 | } 140 | self.delegate?.didUpdateScannerState(scanner: self, state: state) 141 | } 142 | 143 | public func centralManager(_ central: CBCentralManager, 144 | didDiscover peripheral: CBPeripheral, 145 | advertisementData: [String : Any], 146 | rssi RSSI: NSNumber) { 147 | guard let serviceData = advertisementData[CBAdvertisementDataServiceDataKey] 148 | as? [NSObject : AnyObject] else { 149 | return 150 | } 151 | 152 | let frameType = Eddystone.frameTypeForFrame(advertisementFrameList: serviceData) 153 | switch frameType { 154 | case .telemetry: 155 | self.handleTelemetryFrame(peripheral: peripheral, serviceData: serviceData, RSSI: RSSI) 156 | 157 | case .uid, .eid: 158 | self.handleEIDUIDFrame(peripheral: peripheral, serviceData: serviceData, RSSI: RSSI) 159 | 160 | case .url: 161 | self.handleURLFrame(peripheral: peripheral, serviceData: serviceData, RSSI: RSSI) 162 | 163 | default: 164 | debugPrint("Unable to find service data. can't process Eddystone") 165 | } 166 | } 167 | 168 | // MARK: CBCentralManagerDelegate helper methods 169 | /// Handle telemetry frame data 170 | private func handleTelemetryFrame(peripheral: CBPeripheral, 171 | serviceData: [NSObject: AnyObject], 172 | RSSI: NSNumber) { 173 | 174 | guard let beacon = nearbyBeacons.first(where: {$0.identifier == peripheral.identifier}) else { 175 | return 176 | } 177 | 178 | // Save the changing beacon data into the beacon object 179 | let telemetryData = Eddystone.telemetryDataForFrame(advertisementFrameList: serviceData) 180 | beacon.updateBeacon(telemetryData: telemetryData, eddystoneURL: nil, rssi: RSSI.intValue) 181 | self.nearbyBeacons.update(with: beacon) 182 | 183 | self.delegate?.didUpdateBeacon(scanner: self, beacon: beacon) 184 | } 185 | 186 | /// Handle EID UID frame 187 | private func handleEIDUIDFrame(peripheral: CBPeripheral, 188 | serviceData: [NSObject: AnyObject], 189 | RSSI: NSNumber) { 190 | 191 | guard let beacon = nearbyBeacons.first(where: {$0.identifier == peripheral.identifier}) else { 192 | // Newly discovered beacon. Create a new beacon object 193 | let beaconServiceData = serviceData[Eddystone.ServiceUUID] as? Data 194 | guard let beacon = Beacon(identifier: peripheral.identifier, frameData: beaconServiceData, rssi: RSSI.intValue, name: peripheral.name, namespaceFilter: namespaceFilter, filterType: rssiFilterType) else { 195 | return 196 | } 197 | 198 | self.nearbyBeacons.insert(beacon) 199 | self.delegate?.didFindBeacon(scanner: self, beacon: beacon) 200 | return 201 | } 202 | 203 | beacon.updateBeacon(telemetryData: nil, eddystoneURL: nil, rssi: RSSI.intValue) 204 | self.nearbyBeacons.update(with: beacon) 205 | 206 | self.delegate?.didUpdateBeacon(scanner: self, beacon: beacon) 207 | } 208 | 209 | /// Handle URL frame 210 | private func handleURLFrame(peripheral: CBPeripheral, 211 | serviceData: [NSObject: AnyObject], 212 | RSSI: NSNumber) { 213 | 214 | guard let beacon = nearbyBeacons.first(where: {$0.identifier == peripheral.identifier}) else { 215 | return 216 | } 217 | let eddystoneURL = Eddystone.parseURLFromFrame(advertisementFrameList: serviceData) 218 | beacon.updateBeacon(telemetryData: nil, eddystoneURL: eddystoneURL, rssi: RSSI.intValue) 219 | self.nearbyBeacons.update(with: beacon) 220 | 221 | self.delegate?.didUpdateBeacon(scanner: self, beacon: beacon) 222 | } 223 | 224 | } 225 | 226 | extension Scanner: DispatchTimerDelegate { 227 | // MARK: DispatchTimerProtocol delegate callbacks 228 | public func timerCalled(timer: DispatchTimer?) { 229 | // Loop through the beacon list and find which beacon has not been seen in the last 15 seconds 230 | self.nearbyBeacons.filterInPlace() { beacon in 231 | if Date().timeIntervalSince1970 - beacon.lastSeen.timeIntervalSince1970 > 15 { 232 | self.delegate?.didLoseBeacon(scanner: self, beacon: beacon) 233 | return false 234 | } 235 | return true 236 | } 237 | } 238 | } 239 | 240 | -------------------------------------------------------------------------------- /BeaconstacSampleApp/BeaconstacSampleApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | 57 | 63 | 69 | 75 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) 3 | // swift-module-flags: -target arm64-apple-ios10.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Beaconstac 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import Beaconstac 6 | import CoreBluetooth 7 | import CoreData 8 | import CoreLocation 9 | import CoreNFC 10 | import EddystoneScanner 11 | import Foundation 12 | import SafariServices 13 | import Swift 14 | import SystemConfiguration 15 | import UIKit 16 | import UserNotifications 17 | import _Concurrency 18 | import _StringProcessing 19 | public let BEACONSTAC_SDK_NOTIFICATION_IDENTIFIER: Swift.String 20 | public let BEACONSTAC_SDK_ERROR_DOMAIN: Swift.String 21 | public let BEACONSTAC_SDK_NOTIFICATION_URL_KEY: Swift.String 22 | public let BEACON_REGION_IDENTIFIER: Swift.String 23 | @objc public enum BeaconstacSDKError : Swift.Int { 24 | case SDKNotInitialized = -1001 25 | case BluetoothDisabled = -1002 26 | case LocationPermissionDenied = -1003 27 | case LocationTrackingWhenInUseDenied = -1004 28 | case LocationTrackingAlwaysDenied = -1005 29 | case CannotRangeBeacons = -1006 30 | case UnableToConvertStringToDate = -1007 31 | case UnableToConvertDateToString = -1008 32 | case UnableToCreateURL = -1009 33 | case UnableToCreateWebhookHTTPBody = -1010 34 | case PostingToWebhookFailed = -1011 35 | case NetworkErrorOccurred = -1012 36 | case NotConnectedToInternet = -1013 37 | case CachedDataNotFound = -1014 38 | case UserNotFound = -1015 39 | case InvalidRequest = -1016 40 | public init?(rawValue: Swift.Int) 41 | public typealias RawValue = Swift.Int 42 | public var rawValue: Swift.Int { 43 | get 44 | } 45 | } 46 | @objc public enum iBeaconOption : Swift.Int { 47 | case BackgroundRangeOnDisplayWakeUp 48 | case WhenInUseRange 49 | public init?(rawValue: Swift.Int) 50 | public typealias RawValue = Swift.Int 51 | public var rawValue: Swift.Int { 52 | get 53 | } 54 | } 55 | @objc public enum LatchLatency : Swift.Int64 { 56 | case LOW = 3 57 | case MEDIUM = 5 58 | case HIGH = 7 59 | public init?(rawValue: Swift.Int64) 60 | public typealias RawValue = Swift.Int64 61 | public var rawValue: Swift.Int64 { 62 | get 63 | } 64 | } 65 | @_hasMissingDesignatedInitializers @objc public class Beaconstac : ObjectiveC.NSObject { 66 | @objc weak public var delegate: Beaconstac.BeaconDelegate? { 67 | @objc get 68 | @objc set 69 | } 70 | @objc weak public var ruleDelegate: Beaconstac.RuleProcessorDelegate? { 71 | @objc get 72 | @objc set 73 | } 74 | @objc weak public var notificationDelegate: Beaconstac.NotificationDelegate? { 75 | @objc get 76 | @objc set 77 | } 78 | @objc weak public var webhookDelegate: Beaconstac.WebhookDelegate? { 79 | @objc get 80 | @objc set 81 | } 82 | @objc public var latchLatency: Beaconstac.LatchLatency { 83 | @objc get 84 | @objc set 85 | } 86 | @objc deinit 87 | @objc public class func sharedInstance() throws -> Beaconstac.Beaconstac 88 | @objc public class func sharedInstance(_ token: Swift.String, ibeaconOption: Beaconstac.iBeaconOption = .WhenInUseRange, organization: Foundation.NSNumber? = -1, offlineMode: Swift.Bool = true, delegate: Beaconstac.BeaconDelegate? = nil, completion: @escaping (Beaconstac.Beaconstac?, Swift.Error?) -> ()) 89 | @objc public func startScanningBeacons() 90 | @objc public func stopScanningBeacons() 91 | } 92 | @objc extension Beaconstac.Beaconstac { 93 | @objc dynamic public func notificationOptionsForBeaconstacNotification(_ notification: UserNotifications.UNNotification) -> UserNotifications.UNNotificationPresentationOptions 94 | @objc dynamic public func showCardViewerForLocalNotification(_ notification: UserNotifications.UNNotification) -> Swift.Bool 95 | @objc dynamic public func dismissCardViewer() 96 | } 97 | @objc extension Beaconstac.Beaconstac { 98 | @objc dynamic public func addFilters(_ filters: Swift.Dictionary) 99 | @objc dynamic public func setVisitor(_ visitor: Beaconstac.MVisitor) 100 | } 101 | @_hasMissingDesignatedInitializers @objc public class MRule : ObjectiveC.NSObject { 102 | @objc public var id: Swift.Int64 { 103 | get 104 | } 105 | @objc public var name: Swift.String { 106 | get 107 | } 108 | @objc public var dwellTime: Swift.Int64 { 109 | get 110 | } 111 | @objc public var ruleBy: Swift.String { 112 | get 113 | } 114 | @objc public var triggerEvent: Swift.Int64 { 115 | get 116 | } 117 | @objc public var actions: Swift.Array { 118 | get 119 | } 120 | @objc public var placeNames: [Swift.String]? { 121 | get 122 | } 123 | @objc public func isActive() -> Swift.Bool 124 | @objc deinit 125 | } 126 | @_inheritsConvenienceInitializers @objc(NFCTagEntity) public class NFCTagEntity : CoreData.NSManagedObject { 127 | @objc override dynamic public init(entity: CoreData.NSEntityDescription, insertInto context: CoreData.NSManagedObjectContext?) 128 | @objc deinit 129 | } 130 | @_hasMissingDesignatedInitializers @objc public class MNotification : Beaconstac.MAction { 131 | @objc public var id: Swift.Int64 { 132 | get 133 | } 134 | @objc public var title: Swift.String { 135 | get 136 | } 137 | @objc public var body: Swift.String { 138 | get 139 | } 140 | @objc public var okActionURL: Swift.String? { 141 | get 142 | } 143 | @objc public var markdownCard: Beaconstac.MMarkdownCard? { 144 | get 145 | } 146 | @objc deinit 147 | } 148 | @objc public class MVisitor : ObjectiveC.NSObject { 149 | @objc public var firstName: Swift.String { 150 | get 151 | } 152 | @objc public var lastName: Swift.String { 153 | get 154 | } 155 | @objc public var email: Swift.String? { 156 | get 157 | } 158 | @objc public var age: Foundation.NSNumber? { 159 | get 160 | } 161 | @objc public var gender: Swift.String? { 162 | get 163 | } 164 | @objc public init(_ firstName: Swift.String, lastName: Swift.String, email: Swift.String? = nil, age: Foundation.NSNumber? = nil, gender: Swift.String? = nil) 165 | @objc deinit 166 | } 167 | @objc public protocol BeaconDelegate { 168 | @objc func didFail(_ beaconstac: Beaconstac.Beaconstac, error: Swift.Error) 169 | @objc optional func didEnterRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 170 | @objc optional func didRangeBeacons(_ beaconstac: Beaconstac.Beaconstac, beacons: [Beaconstac.MBeacon]) 171 | @objc optional func campOnBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 172 | @objc optional func exitBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 173 | @objc optional func didExitRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 174 | } 175 | @objc public protocol NotificationDelegate { 176 | @objc func overrideNotification(_ beaconstac: Beaconstac.Beaconstac, notification: Beaconstac.MNotification) 177 | } 178 | @objc public protocol WebhookDelegate { 179 | @objc func addParameters(_ beaconstac: Beaconstac.Beaconstac, webhook: Beaconstac.MWebhook) -> Swift.Dictionary 180 | } 181 | @objc public protocol RuleProcessorDelegate { 182 | @objc func willTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 183 | @objc func didTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 184 | } 185 | @_inheritsConvenienceInitializers @objc public class MAction : ObjectiveC.NSObject { 186 | @objc override dynamic public init() 187 | @objc deinit 188 | } 189 | public enum ReachabilityError : Swift.Error { 190 | case FailedToCreateWithAddress(Darwin.sockaddr_in) 191 | case FailedToCreateWithHostname(Swift.String) 192 | case UnableToSetCallback 193 | case UnableToSetDispatchQueue 194 | } 195 | @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") 196 | public let ReachabilityChangedNotification: Foundation.NSNotification.Name 197 | extension Foundation.NSNotification.Name { 198 | public static let reachabilityChanged: Foundation.NSNotification.Name 199 | } 200 | public class Reachability { 201 | public typealias NetworkReachable = (Beaconstac.Reachability) -> () 202 | public typealias NetworkUnreachable = (Beaconstac.Reachability) -> () 203 | @available(*, unavailable, renamed: "Conection") 204 | public enum NetworkStatus : Swift.CustomStringConvertible { 205 | case notReachable, reachableViaWiFi, reachableViaWWAN 206 | public var description: Swift.String { 207 | get 208 | } 209 | public static func == (a: Beaconstac.Reachability.NetworkStatus, b: Beaconstac.Reachability.NetworkStatus) -> Swift.Bool 210 | public func hash(into hasher: inout Swift.Hasher) 211 | public var hashValue: Swift.Int { 212 | get 213 | } 214 | } 215 | public enum Connection : Swift.CustomStringConvertible { 216 | case none, wifi, cellular 217 | public var description: Swift.String { 218 | get 219 | } 220 | public static func == (a: Beaconstac.Reachability.Connection, b: Beaconstac.Reachability.Connection) -> Swift.Bool 221 | public func hash(into hasher: inout Swift.Hasher) 222 | public var hashValue: Swift.Int { 223 | get 224 | } 225 | } 226 | public var whenReachable: Beaconstac.Reachability.NetworkReachable? 227 | public var whenUnreachable: Beaconstac.Reachability.NetworkUnreachable? 228 | @available(*, deprecated, renamed: "allowsCellularConnection") 229 | final public let reachableOnWWAN: Swift.Bool 230 | public var allowsCellularConnection: Swift.Bool 231 | public var notificationCenter: Foundation.NotificationCenter 232 | @available(*, deprecated, renamed: "connection.description") 233 | public var currentReachabilityString: Swift.String { 234 | get 235 | } 236 | @available(*, unavailable, renamed: "connection") 237 | public var currentReachabilityStatus: Beaconstac.Reachability.Connection { 238 | get 239 | } 240 | public var connection: Beaconstac.Reachability.Connection { 241 | get 242 | } 243 | required public init(reachabilityRef: SystemConfiguration.SCNetworkReachability) 244 | convenience public init?(hostname: Swift.String) 245 | convenience public init?() 246 | @objc deinit 247 | } 248 | extension Beaconstac.Reachability { 249 | public func startNotifier() throws 250 | public func stopNotifier() 251 | @available(*, deprecated, message: "Please use `connection != .none`") 252 | public var isReachable: Swift.Bool { 253 | get 254 | } 255 | @available(*, deprecated, message: "Please use `connection == .cellular`") 256 | public var isReachableViaWWAN: Swift.Bool { 257 | get 258 | } 259 | @available(*, deprecated, message: "Please use `connection == .wifi`") 260 | public var isReachableViaWiFi: Swift.Bool { 261 | get 262 | } 263 | public var description: Swift.String { 264 | get 265 | } 266 | } 267 | @objc public enum MNFCTagType : Swift.Int { 268 | case unknown = 0 269 | case sticker = 7 270 | case keycard = 8 271 | public init?(rawValue: Swift.Int) 272 | public typealias RawValue = Swift.Int 273 | public var rawValue: Swift.Int { 274 | get 275 | } 276 | } 277 | @_hasMissingDesignatedInitializers @objc public class MNFCTag : ObjectiveC.NSObject { 278 | @objc public var id: Swift.Int64 { 279 | get 280 | } 281 | @objc public var name: Swift.String { 282 | get 283 | } 284 | @objc public var url: Swift.String { 285 | get 286 | } 287 | @objc public var uid: Swift.String { 288 | get 289 | } 290 | @objc public var counter: Swift.Int64 { 291 | get 292 | } 293 | @objc public var state: Beaconstac.HardwareState { 294 | get 295 | } 296 | @objc public var place: Swift.Int64 { 297 | get 298 | } 299 | @objc public var placeName: Swift.String { 300 | get 301 | } 302 | @objc public var tags: [Swift.String] { 303 | get 304 | } 305 | @objc public var type: Beaconstac.MNFCTagType { 306 | get 307 | } 308 | @objc deinit 309 | } 310 | @_hasMissingDesignatedInitializers @objc public class MWebhook : Beaconstac.MAction { 311 | @objc public var id: Swift.Int64 { 312 | get 313 | } 314 | @objc public var name: Swift.String { 315 | get 316 | } 317 | @objc public var url: Swift.String { 318 | get 319 | } 320 | @objc public var status: Swift.String { 321 | get 322 | } 323 | @objc public var params: Swift.Dictionary? { 324 | get 325 | } 326 | @objc deinit 327 | } 328 | @objc public enum HardwareState : Swift.Int { 329 | case active 330 | case sleeping 331 | public init?(rawValue: Swift.Int) 332 | public typealias RawValue = Swift.Int 333 | public var rawValue: Swift.Int { 334 | get 335 | } 336 | } 337 | @objc public enum BeaconHardwareType : Swift.Int { 338 | case unknown 339 | case indoor 340 | case outdoor 341 | case pocket 342 | case keychain 343 | case longrange 344 | case usb 345 | public init?(rawValue: Swift.Int) 346 | public typealias RawValue = Swift.Int 347 | public var rawValue: Swift.Int { 348 | get 349 | } 350 | } 351 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MEddystone : ObjectiveC.NSObject { 352 | @objc public var nid: Swift.String { 353 | get 354 | } 355 | @objc public var bid: Swift.String { 356 | get 357 | } 358 | @objc public var url: Swift.String { 359 | get 360 | } 361 | @objc deinit 362 | } 363 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MHardware : ObjectiveC.NSObject { 364 | @objc public var UUID: Swift.String { 365 | get 366 | } 367 | @objc public var major: Swift.Int64 { 368 | get 369 | } 370 | @objc public var minor: Swift.Int64 { 371 | get 372 | } 373 | @objc public var serialNumber: Swift.String { 374 | get 375 | } 376 | @objc public var mode: Swift.String { 377 | get 378 | } 379 | @objc public var temperature: Swift.Int64 { 380 | get 381 | } 382 | @objc public var battery: Swift.Int64 { 383 | get 384 | } 385 | @objc public var advertisingInterval: Swift.Int64 { 386 | get 387 | } 388 | @objc public var transmissionPower: Swift.Int64 { 389 | get 390 | } 391 | @objc public var firmwareVersion: Swift.String { 392 | get 393 | } 394 | @objc public var type: Beaconstac.BeaconHardwareType { 395 | get 396 | } 397 | @objc public var eddystone: Beaconstac.MEddystone { 398 | get 399 | } 400 | @objc deinit 401 | } 402 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MBeacon : ObjectiveC.NSObject { 403 | @objc public var id: Swift.Int64 { 404 | get 405 | } 406 | @objc public var name: Swift.String { 407 | get 408 | } 409 | @objc public var isCampedOn: Swift.Bool { 410 | get 411 | } 412 | @objc public var state: Beaconstac.HardwareState { 413 | get 414 | } 415 | @objc public var place: Swift.Int64 { 416 | get 417 | } 418 | @objc public var placeName: Swift.String { 419 | get 420 | } 421 | @objc public var latitude: Swift.Double { 422 | get 423 | } 424 | @objc public var longitude: Swift.Double { 425 | get 426 | } 427 | @objc public var tags: [Swift.String] { 428 | get 429 | } 430 | @objc public var hardware: Beaconstac.MHardware { 431 | get 432 | } 433 | @objc public var latestRSSI: Swift.Int64 434 | @objc deinit 435 | } 436 | @_hasMissingDesignatedInitializers @objc public class MMarkdownCard : ObjectiveC.NSObject { 437 | @objc public var id: Swift.Int64 { 438 | get 439 | } 440 | @objc public var title: Swift.String { 441 | get 442 | } 443 | @objc public var url: Swift.String { 444 | get 445 | } 446 | @objc deinit 447 | } 448 | extension Beaconstac.BeaconstacSDKError : Swift.Equatable {} 449 | extension Beaconstac.BeaconstacSDKError : Swift.Hashable {} 450 | extension Beaconstac.BeaconstacSDKError : Swift.RawRepresentable {} 451 | extension Beaconstac.iBeaconOption : Swift.Equatable {} 452 | extension Beaconstac.iBeaconOption : Swift.Hashable {} 453 | extension Beaconstac.iBeaconOption : Swift.RawRepresentable {} 454 | extension Beaconstac.LatchLatency : Swift.Equatable {} 455 | extension Beaconstac.LatchLatency : Swift.Hashable {} 456 | extension Beaconstac.LatchLatency : Swift.RawRepresentable {} 457 | @available(*, unavailable, renamed: "Conection") 458 | extension Beaconstac.Reachability.NetworkStatus : Swift.Equatable {} 459 | @available(*, unavailable, renamed: "Conection") 460 | extension Beaconstac.Reachability.NetworkStatus : Swift.Hashable {} 461 | extension Beaconstac.Reachability.Connection : Swift.Equatable {} 462 | extension Beaconstac.Reachability.Connection : Swift.Hashable {} 463 | extension Beaconstac.MNFCTagType : Swift.Equatable {} 464 | extension Beaconstac.MNFCTagType : Swift.Hashable {} 465 | extension Beaconstac.MNFCTagType : Swift.RawRepresentable {} 466 | extension Beaconstac.HardwareState : Swift.Equatable {} 467 | extension Beaconstac.HardwareState : Swift.Hashable {} 468 | extension Beaconstac.HardwareState : Swift.RawRepresentable {} 469 | extension Beaconstac.BeaconHardwareType : Swift.Equatable {} 470 | extension Beaconstac.BeaconHardwareType : Swift.Hashable {} 471 | extension Beaconstac.BeaconHardwareType : Swift.RawRepresentable {} 472 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/arm64-apple-ios.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) 3 | // swift-module-flags: -target arm64-apple-ios10.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Beaconstac 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import Beaconstac 6 | import CoreBluetooth 7 | import CoreData 8 | import CoreLocation 9 | import CoreNFC 10 | import EddystoneScanner 11 | import Foundation 12 | import SafariServices 13 | import Swift 14 | import SystemConfiguration 15 | import UIKit 16 | import UserNotifications 17 | import _Concurrency 18 | import _StringProcessing 19 | public let BEACONSTAC_SDK_NOTIFICATION_IDENTIFIER: Swift.String 20 | public let BEACONSTAC_SDK_ERROR_DOMAIN: Swift.String 21 | public let BEACONSTAC_SDK_NOTIFICATION_URL_KEY: Swift.String 22 | public let BEACON_REGION_IDENTIFIER: Swift.String 23 | @objc public enum BeaconstacSDKError : Swift.Int { 24 | case SDKNotInitialized = -1001 25 | case BluetoothDisabled = -1002 26 | case LocationPermissionDenied = -1003 27 | case LocationTrackingWhenInUseDenied = -1004 28 | case LocationTrackingAlwaysDenied = -1005 29 | case CannotRangeBeacons = -1006 30 | case UnableToConvertStringToDate = -1007 31 | case UnableToConvertDateToString = -1008 32 | case UnableToCreateURL = -1009 33 | case UnableToCreateWebhookHTTPBody = -1010 34 | case PostingToWebhookFailed = -1011 35 | case NetworkErrorOccurred = -1012 36 | case NotConnectedToInternet = -1013 37 | case CachedDataNotFound = -1014 38 | case UserNotFound = -1015 39 | case InvalidRequest = -1016 40 | public init?(rawValue: Swift.Int) 41 | public typealias RawValue = Swift.Int 42 | public var rawValue: Swift.Int { 43 | get 44 | } 45 | } 46 | @objc public enum iBeaconOption : Swift.Int { 47 | case BackgroundRangeOnDisplayWakeUp 48 | case WhenInUseRange 49 | public init?(rawValue: Swift.Int) 50 | public typealias RawValue = Swift.Int 51 | public var rawValue: Swift.Int { 52 | get 53 | } 54 | } 55 | @objc public enum LatchLatency : Swift.Int64 { 56 | case LOW = 3 57 | case MEDIUM = 5 58 | case HIGH = 7 59 | public init?(rawValue: Swift.Int64) 60 | public typealias RawValue = Swift.Int64 61 | public var rawValue: Swift.Int64 { 62 | get 63 | } 64 | } 65 | @_hasMissingDesignatedInitializers @objc public class Beaconstac : ObjectiveC.NSObject { 66 | @objc weak public var delegate: Beaconstac.BeaconDelegate? { 67 | @objc get 68 | @objc set 69 | } 70 | @objc weak public var ruleDelegate: Beaconstac.RuleProcessorDelegate? { 71 | @objc get 72 | @objc set 73 | } 74 | @objc weak public var notificationDelegate: Beaconstac.NotificationDelegate? { 75 | @objc get 76 | @objc set 77 | } 78 | @objc weak public var webhookDelegate: Beaconstac.WebhookDelegate? { 79 | @objc get 80 | @objc set 81 | } 82 | @objc public var latchLatency: Beaconstac.LatchLatency { 83 | @objc get 84 | @objc set 85 | } 86 | @objc deinit 87 | @objc public class func sharedInstance() throws -> Beaconstac.Beaconstac 88 | @objc public class func sharedInstance(_ token: Swift.String, ibeaconOption: Beaconstac.iBeaconOption = .WhenInUseRange, organization: Foundation.NSNumber? = -1, offlineMode: Swift.Bool = true, delegate: Beaconstac.BeaconDelegate? = nil, completion: @escaping (Beaconstac.Beaconstac?, Swift.Error?) -> ()) 89 | @objc public func startScanningBeacons() 90 | @objc public func stopScanningBeacons() 91 | } 92 | @objc extension Beaconstac.Beaconstac { 93 | @objc dynamic public func notificationOptionsForBeaconstacNotification(_ notification: UserNotifications.UNNotification) -> UserNotifications.UNNotificationPresentationOptions 94 | @objc dynamic public func showCardViewerForLocalNotification(_ notification: UserNotifications.UNNotification) -> Swift.Bool 95 | @objc dynamic public func dismissCardViewer() 96 | } 97 | @objc extension Beaconstac.Beaconstac { 98 | @objc dynamic public func addFilters(_ filters: Swift.Dictionary) 99 | @objc dynamic public func setVisitor(_ visitor: Beaconstac.MVisitor) 100 | } 101 | @_hasMissingDesignatedInitializers @objc public class MRule : ObjectiveC.NSObject { 102 | @objc public var id: Swift.Int64 { 103 | get 104 | } 105 | @objc public var name: Swift.String { 106 | get 107 | } 108 | @objc public var dwellTime: Swift.Int64 { 109 | get 110 | } 111 | @objc public var ruleBy: Swift.String { 112 | get 113 | } 114 | @objc public var triggerEvent: Swift.Int64 { 115 | get 116 | } 117 | @objc public var actions: Swift.Array { 118 | get 119 | } 120 | @objc public var placeNames: [Swift.String]? { 121 | get 122 | } 123 | @objc public func isActive() -> Swift.Bool 124 | @objc deinit 125 | } 126 | @_inheritsConvenienceInitializers @objc(NFCTagEntity) public class NFCTagEntity : CoreData.NSManagedObject { 127 | @objc override dynamic public init(entity: CoreData.NSEntityDescription, insertInto context: CoreData.NSManagedObjectContext?) 128 | @objc deinit 129 | } 130 | @_hasMissingDesignatedInitializers @objc public class MNotification : Beaconstac.MAction { 131 | @objc public var id: Swift.Int64 { 132 | get 133 | } 134 | @objc public var title: Swift.String { 135 | get 136 | } 137 | @objc public var body: Swift.String { 138 | get 139 | } 140 | @objc public var okActionURL: Swift.String? { 141 | get 142 | } 143 | @objc public var markdownCard: Beaconstac.MMarkdownCard? { 144 | get 145 | } 146 | @objc deinit 147 | } 148 | @objc public class MVisitor : ObjectiveC.NSObject { 149 | @objc public var firstName: Swift.String { 150 | get 151 | } 152 | @objc public var lastName: Swift.String { 153 | get 154 | } 155 | @objc public var email: Swift.String? { 156 | get 157 | } 158 | @objc public var age: Foundation.NSNumber? { 159 | get 160 | } 161 | @objc public var gender: Swift.String? { 162 | get 163 | } 164 | @objc public init(_ firstName: Swift.String, lastName: Swift.String, email: Swift.String? = nil, age: Foundation.NSNumber? = nil, gender: Swift.String? = nil) 165 | @objc deinit 166 | } 167 | @objc public protocol BeaconDelegate { 168 | @objc func didFail(_ beaconstac: Beaconstac.Beaconstac, error: Swift.Error) 169 | @objc optional func didEnterRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 170 | @objc optional func didRangeBeacons(_ beaconstac: Beaconstac.Beaconstac, beacons: [Beaconstac.MBeacon]) 171 | @objc optional func campOnBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 172 | @objc optional func exitBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 173 | @objc optional func didExitRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 174 | } 175 | @objc public protocol NotificationDelegate { 176 | @objc func overrideNotification(_ beaconstac: Beaconstac.Beaconstac, notification: Beaconstac.MNotification) 177 | } 178 | @objc public protocol WebhookDelegate { 179 | @objc func addParameters(_ beaconstac: Beaconstac.Beaconstac, webhook: Beaconstac.MWebhook) -> Swift.Dictionary 180 | } 181 | @objc public protocol RuleProcessorDelegate { 182 | @objc func willTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 183 | @objc func didTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 184 | } 185 | @_inheritsConvenienceInitializers @objc public class MAction : ObjectiveC.NSObject { 186 | @objc override dynamic public init() 187 | @objc deinit 188 | } 189 | public enum ReachabilityError : Swift.Error { 190 | case FailedToCreateWithAddress(Darwin.sockaddr_in) 191 | case FailedToCreateWithHostname(Swift.String) 192 | case UnableToSetCallback 193 | case UnableToSetDispatchQueue 194 | } 195 | @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") 196 | public let ReachabilityChangedNotification: Foundation.NSNotification.Name 197 | extension Foundation.NSNotification.Name { 198 | public static let reachabilityChanged: Foundation.NSNotification.Name 199 | } 200 | public class Reachability { 201 | public typealias NetworkReachable = (Beaconstac.Reachability) -> () 202 | public typealias NetworkUnreachable = (Beaconstac.Reachability) -> () 203 | @available(*, unavailable, renamed: "Conection") 204 | public enum NetworkStatus : Swift.CustomStringConvertible { 205 | case notReachable, reachableViaWiFi, reachableViaWWAN 206 | public var description: Swift.String { 207 | get 208 | } 209 | public static func == (a: Beaconstac.Reachability.NetworkStatus, b: Beaconstac.Reachability.NetworkStatus) -> Swift.Bool 210 | public func hash(into hasher: inout Swift.Hasher) 211 | public var hashValue: Swift.Int { 212 | get 213 | } 214 | } 215 | public enum Connection : Swift.CustomStringConvertible { 216 | case none, wifi, cellular 217 | public var description: Swift.String { 218 | get 219 | } 220 | public static func == (a: Beaconstac.Reachability.Connection, b: Beaconstac.Reachability.Connection) -> Swift.Bool 221 | public func hash(into hasher: inout Swift.Hasher) 222 | public var hashValue: Swift.Int { 223 | get 224 | } 225 | } 226 | public var whenReachable: Beaconstac.Reachability.NetworkReachable? 227 | public var whenUnreachable: Beaconstac.Reachability.NetworkUnreachable? 228 | @available(*, deprecated, renamed: "allowsCellularConnection") 229 | final public let reachableOnWWAN: Swift.Bool 230 | public var allowsCellularConnection: Swift.Bool 231 | public var notificationCenter: Foundation.NotificationCenter 232 | @available(*, deprecated, renamed: "connection.description") 233 | public var currentReachabilityString: Swift.String { 234 | get 235 | } 236 | @available(*, unavailable, renamed: "connection") 237 | public var currentReachabilityStatus: Beaconstac.Reachability.Connection { 238 | get 239 | } 240 | public var connection: Beaconstac.Reachability.Connection { 241 | get 242 | } 243 | required public init(reachabilityRef: SystemConfiguration.SCNetworkReachability) 244 | convenience public init?(hostname: Swift.String) 245 | convenience public init?() 246 | @objc deinit 247 | } 248 | extension Beaconstac.Reachability { 249 | public func startNotifier() throws 250 | public func stopNotifier() 251 | @available(*, deprecated, message: "Please use `connection != .none`") 252 | public var isReachable: Swift.Bool { 253 | get 254 | } 255 | @available(*, deprecated, message: "Please use `connection == .cellular`") 256 | public var isReachableViaWWAN: Swift.Bool { 257 | get 258 | } 259 | @available(*, deprecated, message: "Please use `connection == .wifi`") 260 | public var isReachableViaWiFi: Swift.Bool { 261 | get 262 | } 263 | public var description: Swift.String { 264 | get 265 | } 266 | } 267 | @objc public enum MNFCTagType : Swift.Int { 268 | case unknown = 0 269 | case sticker = 7 270 | case keycard = 8 271 | public init?(rawValue: Swift.Int) 272 | public typealias RawValue = Swift.Int 273 | public var rawValue: Swift.Int { 274 | get 275 | } 276 | } 277 | @_hasMissingDesignatedInitializers @objc public class MNFCTag : ObjectiveC.NSObject { 278 | @objc public var id: Swift.Int64 { 279 | get 280 | } 281 | @objc public var name: Swift.String { 282 | get 283 | } 284 | @objc public var url: Swift.String { 285 | get 286 | } 287 | @objc public var uid: Swift.String { 288 | get 289 | } 290 | @objc public var counter: Swift.Int64 { 291 | get 292 | } 293 | @objc public var state: Beaconstac.HardwareState { 294 | get 295 | } 296 | @objc public var place: Swift.Int64 { 297 | get 298 | } 299 | @objc public var placeName: Swift.String { 300 | get 301 | } 302 | @objc public var tags: [Swift.String] { 303 | get 304 | } 305 | @objc public var type: Beaconstac.MNFCTagType { 306 | get 307 | } 308 | @objc deinit 309 | } 310 | @_hasMissingDesignatedInitializers @objc public class MWebhook : Beaconstac.MAction { 311 | @objc public var id: Swift.Int64 { 312 | get 313 | } 314 | @objc public var name: Swift.String { 315 | get 316 | } 317 | @objc public var url: Swift.String { 318 | get 319 | } 320 | @objc public var status: Swift.String { 321 | get 322 | } 323 | @objc public var params: Swift.Dictionary? { 324 | get 325 | } 326 | @objc deinit 327 | } 328 | @objc public enum HardwareState : Swift.Int { 329 | case active 330 | case sleeping 331 | public init?(rawValue: Swift.Int) 332 | public typealias RawValue = Swift.Int 333 | public var rawValue: Swift.Int { 334 | get 335 | } 336 | } 337 | @objc public enum BeaconHardwareType : Swift.Int { 338 | case unknown 339 | case indoor 340 | case outdoor 341 | case pocket 342 | case keychain 343 | case longrange 344 | case usb 345 | public init?(rawValue: Swift.Int) 346 | public typealias RawValue = Swift.Int 347 | public var rawValue: Swift.Int { 348 | get 349 | } 350 | } 351 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MEddystone : ObjectiveC.NSObject { 352 | @objc public var nid: Swift.String { 353 | get 354 | } 355 | @objc public var bid: Swift.String { 356 | get 357 | } 358 | @objc public var url: Swift.String { 359 | get 360 | } 361 | @objc deinit 362 | } 363 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MHardware : ObjectiveC.NSObject { 364 | @objc public var UUID: Swift.String { 365 | get 366 | } 367 | @objc public var major: Swift.Int64 { 368 | get 369 | } 370 | @objc public var minor: Swift.Int64 { 371 | get 372 | } 373 | @objc public var serialNumber: Swift.String { 374 | get 375 | } 376 | @objc public var mode: Swift.String { 377 | get 378 | } 379 | @objc public var temperature: Swift.Int64 { 380 | get 381 | } 382 | @objc public var battery: Swift.Int64 { 383 | get 384 | } 385 | @objc public var advertisingInterval: Swift.Int64 { 386 | get 387 | } 388 | @objc public var transmissionPower: Swift.Int64 { 389 | get 390 | } 391 | @objc public var firmwareVersion: Swift.String { 392 | get 393 | } 394 | @objc public var type: Beaconstac.BeaconHardwareType { 395 | get 396 | } 397 | @objc public var eddystone: Beaconstac.MEddystone { 398 | get 399 | } 400 | @objc deinit 401 | } 402 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MBeacon : ObjectiveC.NSObject { 403 | @objc public var id: Swift.Int64 { 404 | get 405 | } 406 | @objc public var name: Swift.String { 407 | get 408 | } 409 | @objc public var isCampedOn: Swift.Bool { 410 | get 411 | } 412 | @objc public var state: Beaconstac.HardwareState { 413 | get 414 | } 415 | @objc public var place: Swift.Int64 { 416 | get 417 | } 418 | @objc public var placeName: Swift.String { 419 | get 420 | } 421 | @objc public var latitude: Swift.Double { 422 | get 423 | } 424 | @objc public var longitude: Swift.Double { 425 | get 426 | } 427 | @objc public var tags: [Swift.String] { 428 | get 429 | } 430 | @objc public var hardware: Beaconstac.MHardware { 431 | get 432 | } 433 | @objc public var latestRSSI: Swift.Int64 434 | @objc deinit 435 | } 436 | @_hasMissingDesignatedInitializers @objc public class MMarkdownCard : ObjectiveC.NSObject { 437 | @objc public var id: Swift.Int64 { 438 | get 439 | } 440 | @objc public var title: Swift.String { 441 | get 442 | } 443 | @objc public var url: Swift.String { 444 | get 445 | } 446 | @objc deinit 447 | } 448 | extension Beaconstac.BeaconstacSDKError : Swift.Equatable {} 449 | extension Beaconstac.BeaconstacSDKError : Swift.Hashable {} 450 | extension Beaconstac.BeaconstacSDKError : Swift.RawRepresentable {} 451 | extension Beaconstac.iBeaconOption : Swift.Equatable {} 452 | extension Beaconstac.iBeaconOption : Swift.Hashable {} 453 | extension Beaconstac.iBeaconOption : Swift.RawRepresentable {} 454 | extension Beaconstac.LatchLatency : Swift.Equatable {} 455 | extension Beaconstac.LatchLatency : Swift.Hashable {} 456 | extension Beaconstac.LatchLatency : Swift.RawRepresentable {} 457 | @available(*, unavailable, renamed: "Conection") 458 | extension Beaconstac.Reachability.NetworkStatus : Swift.Equatable {} 459 | @available(*, unavailable, renamed: "Conection") 460 | extension Beaconstac.Reachability.NetworkStatus : Swift.Hashable {} 461 | extension Beaconstac.Reachability.Connection : Swift.Equatable {} 462 | extension Beaconstac.Reachability.Connection : Swift.Hashable {} 463 | extension Beaconstac.MNFCTagType : Swift.Equatable {} 464 | extension Beaconstac.MNFCTagType : Swift.Hashable {} 465 | extension Beaconstac.MNFCTagType : Swift.RawRepresentable {} 466 | extension Beaconstac.HardwareState : Swift.Equatable {} 467 | extension Beaconstac.HardwareState : Swift.Hashable {} 468 | extension Beaconstac.HardwareState : Swift.RawRepresentable {} 469 | extension Beaconstac.BeaconHardwareType : Swift.Equatable {} 470 | extension Beaconstac.BeaconHardwareType : Swift.Hashable {} 471 | extension Beaconstac.BeaconHardwareType : Swift.RawRepresentable {} 472 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) 3 | // swift-module-flags: -target x86_64-apple-ios10.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Beaconstac 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import Beaconstac 6 | import CoreBluetooth 7 | import CoreData 8 | import CoreLocation 9 | import CoreNFC 10 | import EddystoneScanner 11 | import Foundation 12 | import SafariServices 13 | import Swift 14 | import SystemConfiguration 15 | import UIKit 16 | import UserNotifications 17 | import _Concurrency 18 | import _StringProcessing 19 | public let BEACONSTAC_SDK_NOTIFICATION_IDENTIFIER: Swift.String 20 | public let BEACONSTAC_SDK_ERROR_DOMAIN: Swift.String 21 | public let BEACONSTAC_SDK_NOTIFICATION_URL_KEY: Swift.String 22 | public let BEACON_REGION_IDENTIFIER: Swift.String 23 | @objc public enum BeaconstacSDKError : Swift.Int { 24 | case SDKNotInitialized = -1001 25 | case BluetoothDisabled = -1002 26 | case LocationPermissionDenied = -1003 27 | case LocationTrackingWhenInUseDenied = -1004 28 | case LocationTrackingAlwaysDenied = -1005 29 | case CannotRangeBeacons = -1006 30 | case UnableToConvertStringToDate = -1007 31 | case UnableToConvertDateToString = -1008 32 | case UnableToCreateURL = -1009 33 | case UnableToCreateWebhookHTTPBody = -1010 34 | case PostingToWebhookFailed = -1011 35 | case NetworkErrorOccurred = -1012 36 | case NotConnectedToInternet = -1013 37 | case CachedDataNotFound = -1014 38 | case UserNotFound = -1015 39 | case InvalidRequest = -1016 40 | public init?(rawValue: Swift.Int) 41 | public typealias RawValue = Swift.Int 42 | public var rawValue: Swift.Int { 43 | get 44 | } 45 | } 46 | @objc public enum iBeaconOption : Swift.Int { 47 | case BackgroundRangeOnDisplayWakeUp 48 | case WhenInUseRange 49 | public init?(rawValue: Swift.Int) 50 | public typealias RawValue = Swift.Int 51 | public var rawValue: Swift.Int { 52 | get 53 | } 54 | } 55 | @objc public enum LatchLatency : Swift.Int64 { 56 | case LOW = 3 57 | case MEDIUM = 5 58 | case HIGH = 7 59 | public init?(rawValue: Swift.Int64) 60 | public typealias RawValue = Swift.Int64 61 | public var rawValue: Swift.Int64 { 62 | get 63 | } 64 | } 65 | @_hasMissingDesignatedInitializers @objc public class Beaconstac : ObjectiveC.NSObject { 66 | @objc weak public var delegate: Beaconstac.BeaconDelegate? { 67 | @objc get 68 | @objc set 69 | } 70 | @objc weak public var ruleDelegate: Beaconstac.RuleProcessorDelegate? { 71 | @objc get 72 | @objc set 73 | } 74 | @objc weak public var notificationDelegate: Beaconstac.NotificationDelegate? { 75 | @objc get 76 | @objc set 77 | } 78 | @objc weak public var webhookDelegate: Beaconstac.WebhookDelegate? { 79 | @objc get 80 | @objc set 81 | } 82 | @objc public var latchLatency: Beaconstac.LatchLatency { 83 | @objc get 84 | @objc set 85 | } 86 | @objc deinit 87 | @objc public class func sharedInstance() throws -> Beaconstac.Beaconstac 88 | @objc public class func sharedInstance(_ token: Swift.String, ibeaconOption: Beaconstac.iBeaconOption = .WhenInUseRange, organization: Foundation.NSNumber? = -1, offlineMode: Swift.Bool = true, delegate: Beaconstac.BeaconDelegate? = nil, completion: @escaping (Beaconstac.Beaconstac?, Swift.Error?) -> ()) 89 | @objc public func startScanningBeacons() 90 | @objc public func stopScanningBeacons() 91 | } 92 | @objc extension Beaconstac.Beaconstac { 93 | @objc dynamic public func notificationOptionsForBeaconstacNotification(_ notification: UserNotifications.UNNotification) -> UserNotifications.UNNotificationPresentationOptions 94 | @objc dynamic public func showCardViewerForLocalNotification(_ notification: UserNotifications.UNNotification) -> Swift.Bool 95 | @objc dynamic public func dismissCardViewer() 96 | } 97 | @objc extension Beaconstac.Beaconstac { 98 | @objc dynamic public func addFilters(_ filters: Swift.Dictionary) 99 | @objc dynamic public func setVisitor(_ visitor: Beaconstac.MVisitor) 100 | } 101 | @_hasMissingDesignatedInitializers @objc public class MRule : ObjectiveC.NSObject { 102 | @objc public var id: Swift.Int64 { 103 | get 104 | } 105 | @objc public var name: Swift.String { 106 | get 107 | } 108 | @objc public var dwellTime: Swift.Int64 { 109 | get 110 | } 111 | @objc public var ruleBy: Swift.String { 112 | get 113 | } 114 | @objc public var triggerEvent: Swift.Int64 { 115 | get 116 | } 117 | @objc public var actions: Swift.Array { 118 | get 119 | } 120 | @objc public var placeNames: [Swift.String]? { 121 | get 122 | } 123 | @objc public func isActive() -> Swift.Bool 124 | @objc deinit 125 | } 126 | @_inheritsConvenienceInitializers @objc(NFCTagEntity) public class NFCTagEntity : CoreData.NSManagedObject { 127 | @objc override dynamic public init(entity: CoreData.NSEntityDescription, insertInto context: CoreData.NSManagedObjectContext?) 128 | @objc deinit 129 | } 130 | @_hasMissingDesignatedInitializers @objc public class MNotification : Beaconstac.MAction { 131 | @objc public var id: Swift.Int64 { 132 | get 133 | } 134 | @objc public var title: Swift.String { 135 | get 136 | } 137 | @objc public var body: Swift.String { 138 | get 139 | } 140 | @objc public var okActionURL: Swift.String? { 141 | get 142 | } 143 | @objc public var markdownCard: Beaconstac.MMarkdownCard? { 144 | get 145 | } 146 | @objc deinit 147 | } 148 | @objc public class MVisitor : ObjectiveC.NSObject { 149 | @objc public var firstName: Swift.String { 150 | get 151 | } 152 | @objc public var lastName: Swift.String { 153 | get 154 | } 155 | @objc public var email: Swift.String? { 156 | get 157 | } 158 | @objc public var age: Foundation.NSNumber? { 159 | get 160 | } 161 | @objc public var gender: Swift.String? { 162 | get 163 | } 164 | @objc public init(_ firstName: Swift.String, lastName: Swift.String, email: Swift.String? = nil, age: Foundation.NSNumber? = nil, gender: Swift.String? = nil) 165 | @objc deinit 166 | } 167 | @objc public protocol BeaconDelegate { 168 | @objc func didFail(_ beaconstac: Beaconstac.Beaconstac, error: Swift.Error) 169 | @objc optional func didEnterRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 170 | @objc optional func didRangeBeacons(_ beaconstac: Beaconstac.Beaconstac, beacons: [Beaconstac.MBeacon]) 171 | @objc optional func campOnBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 172 | @objc optional func exitBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 173 | @objc optional func didExitRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 174 | } 175 | @objc public protocol NotificationDelegate { 176 | @objc func overrideNotification(_ beaconstac: Beaconstac.Beaconstac, notification: Beaconstac.MNotification) 177 | } 178 | @objc public protocol WebhookDelegate { 179 | @objc func addParameters(_ beaconstac: Beaconstac.Beaconstac, webhook: Beaconstac.MWebhook) -> Swift.Dictionary 180 | } 181 | @objc public protocol RuleProcessorDelegate { 182 | @objc func willTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 183 | @objc func didTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 184 | } 185 | @_inheritsConvenienceInitializers @objc public class MAction : ObjectiveC.NSObject { 186 | @objc override dynamic public init() 187 | @objc deinit 188 | } 189 | public enum ReachabilityError : Swift.Error { 190 | case FailedToCreateWithAddress(Darwin.sockaddr_in) 191 | case FailedToCreateWithHostname(Swift.String) 192 | case UnableToSetCallback 193 | case UnableToSetDispatchQueue 194 | } 195 | @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") 196 | public let ReachabilityChangedNotification: Foundation.NSNotification.Name 197 | extension Foundation.NSNotification.Name { 198 | public static let reachabilityChanged: Foundation.NSNotification.Name 199 | } 200 | public class Reachability { 201 | public typealias NetworkReachable = (Beaconstac.Reachability) -> () 202 | public typealias NetworkUnreachable = (Beaconstac.Reachability) -> () 203 | @available(*, unavailable, renamed: "Conection") 204 | public enum NetworkStatus : Swift.CustomStringConvertible { 205 | case notReachable, reachableViaWiFi, reachableViaWWAN 206 | public var description: Swift.String { 207 | get 208 | } 209 | public static func == (a: Beaconstac.Reachability.NetworkStatus, b: Beaconstac.Reachability.NetworkStatus) -> Swift.Bool 210 | public func hash(into hasher: inout Swift.Hasher) 211 | public var hashValue: Swift.Int { 212 | get 213 | } 214 | } 215 | public enum Connection : Swift.CustomStringConvertible { 216 | case none, wifi, cellular 217 | public var description: Swift.String { 218 | get 219 | } 220 | public static func == (a: Beaconstac.Reachability.Connection, b: Beaconstac.Reachability.Connection) -> Swift.Bool 221 | public func hash(into hasher: inout Swift.Hasher) 222 | public var hashValue: Swift.Int { 223 | get 224 | } 225 | } 226 | public var whenReachable: Beaconstac.Reachability.NetworkReachable? 227 | public var whenUnreachable: Beaconstac.Reachability.NetworkUnreachable? 228 | @available(*, deprecated, renamed: "allowsCellularConnection") 229 | final public let reachableOnWWAN: Swift.Bool 230 | public var allowsCellularConnection: Swift.Bool 231 | public var notificationCenter: Foundation.NotificationCenter 232 | @available(*, deprecated, renamed: "connection.description") 233 | public var currentReachabilityString: Swift.String { 234 | get 235 | } 236 | @available(*, unavailable, renamed: "connection") 237 | public var currentReachabilityStatus: Beaconstac.Reachability.Connection { 238 | get 239 | } 240 | public var connection: Beaconstac.Reachability.Connection { 241 | get 242 | } 243 | required public init(reachabilityRef: SystemConfiguration.SCNetworkReachability) 244 | convenience public init?(hostname: Swift.String) 245 | convenience public init?() 246 | @objc deinit 247 | } 248 | extension Beaconstac.Reachability { 249 | public func startNotifier() throws 250 | public func stopNotifier() 251 | @available(*, deprecated, message: "Please use `connection != .none`") 252 | public var isReachable: Swift.Bool { 253 | get 254 | } 255 | @available(*, deprecated, message: "Please use `connection == .cellular`") 256 | public var isReachableViaWWAN: Swift.Bool { 257 | get 258 | } 259 | @available(*, deprecated, message: "Please use `connection == .wifi`") 260 | public var isReachableViaWiFi: Swift.Bool { 261 | get 262 | } 263 | public var description: Swift.String { 264 | get 265 | } 266 | } 267 | @objc public enum MNFCTagType : Swift.Int { 268 | case unknown = 0 269 | case sticker = 7 270 | case keycard = 8 271 | public init?(rawValue: Swift.Int) 272 | public typealias RawValue = Swift.Int 273 | public var rawValue: Swift.Int { 274 | get 275 | } 276 | } 277 | @_hasMissingDesignatedInitializers @objc public class MNFCTag : ObjectiveC.NSObject { 278 | @objc public var id: Swift.Int64 { 279 | get 280 | } 281 | @objc public var name: Swift.String { 282 | get 283 | } 284 | @objc public var url: Swift.String { 285 | get 286 | } 287 | @objc public var uid: Swift.String { 288 | get 289 | } 290 | @objc public var counter: Swift.Int64 { 291 | get 292 | } 293 | @objc public var state: Beaconstac.HardwareState { 294 | get 295 | } 296 | @objc public var place: Swift.Int64 { 297 | get 298 | } 299 | @objc public var placeName: Swift.String { 300 | get 301 | } 302 | @objc public var tags: [Swift.String] { 303 | get 304 | } 305 | @objc public var type: Beaconstac.MNFCTagType { 306 | get 307 | } 308 | @objc deinit 309 | } 310 | @_hasMissingDesignatedInitializers @objc public class MWebhook : Beaconstac.MAction { 311 | @objc public var id: Swift.Int64 { 312 | get 313 | } 314 | @objc public var name: Swift.String { 315 | get 316 | } 317 | @objc public var url: Swift.String { 318 | get 319 | } 320 | @objc public var status: Swift.String { 321 | get 322 | } 323 | @objc public var params: Swift.Dictionary? { 324 | get 325 | } 326 | @objc deinit 327 | } 328 | @objc public enum HardwareState : Swift.Int { 329 | case active 330 | case sleeping 331 | public init?(rawValue: Swift.Int) 332 | public typealias RawValue = Swift.Int 333 | public var rawValue: Swift.Int { 334 | get 335 | } 336 | } 337 | @objc public enum BeaconHardwareType : Swift.Int { 338 | case unknown 339 | case indoor 340 | case outdoor 341 | case pocket 342 | case keychain 343 | case longrange 344 | case usb 345 | public init?(rawValue: Swift.Int) 346 | public typealias RawValue = Swift.Int 347 | public var rawValue: Swift.Int { 348 | get 349 | } 350 | } 351 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MEddystone : ObjectiveC.NSObject { 352 | @objc public var nid: Swift.String { 353 | get 354 | } 355 | @objc public var bid: Swift.String { 356 | get 357 | } 358 | @objc public var url: Swift.String { 359 | get 360 | } 361 | @objc deinit 362 | } 363 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MHardware : ObjectiveC.NSObject { 364 | @objc public var UUID: Swift.String { 365 | get 366 | } 367 | @objc public var major: Swift.Int64 { 368 | get 369 | } 370 | @objc public var minor: Swift.Int64 { 371 | get 372 | } 373 | @objc public var serialNumber: Swift.String { 374 | get 375 | } 376 | @objc public var mode: Swift.String { 377 | get 378 | } 379 | @objc public var temperature: Swift.Int64 { 380 | get 381 | } 382 | @objc public var battery: Swift.Int64 { 383 | get 384 | } 385 | @objc public var advertisingInterval: Swift.Int64 { 386 | get 387 | } 388 | @objc public var transmissionPower: Swift.Int64 { 389 | get 390 | } 391 | @objc public var firmwareVersion: Swift.String { 392 | get 393 | } 394 | @objc public var type: Beaconstac.BeaconHardwareType { 395 | get 396 | } 397 | @objc public var eddystone: Beaconstac.MEddystone { 398 | get 399 | } 400 | @objc deinit 401 | } 402 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MBeacon : ObjectiveC.NSObject { 403 | @objc public var id: Swift.Int64 { 404 | get 405 | } 406 | @objc public var name: Swift.String { 407 | get 408 | } 409 | @objc public var isCampedOn: Swift.Bool { 410 | get 411 | } 412 | @objc public var state: Beaconstac.HardwareState { 413 | get 414 | } 415 | @objc public var place: Swift.Int64 { 416 | get 417 | } 418 | @objc public var placeName: Swift.String { 419 | get 420 | } 421 | @objc public var latitude: Swift.Double { 422 | get 423 | } 424 | @objc public var longitude: Swift.Double { 425 | get 426 | } 427 | @objc public var tags: [Swift.String] { 428 | get 429 | } 430 | @objc public var hardware: Beaconstac.MHardware { 431 | get 432 | } 433 | @objc public var latestRSSI: Swift.Int64 434 | @objc deinit 435 | } 436 | @_hasMissingDesignatedInitializers @objc public class MMarkdownCard : ObjectiveC.NSObject { 437 | @objc public var id: Swift.Int64 { 438 | get 439 | } 440 | @objc public var title: Swift.String { 441 | get 442 | } 443 | @objc public var url: Swift.String { 444 | get 445 | } 446 | @objc deinit 447 | } 448 | extension Beaconstac.BeaconstacSDKError : Swift.Equatable {} 449 | extension Beaconstac.BeaconstacSDKError : Swift.Hashable {} 450 | extension Beaconstac.BeaconstacSDKError : Swift.RawRepresentable {} 451 | extension Beaconstac.iBeaconOption : Swift.Equatable {} 452 | extension Beaconstac.iBeaconOption : Swift.Hashable {} 453 | extension Beaconstac.iBeaconOption : Swift.RawRepresentable {} 454 | extension Beaconstac.LatchLatency : Swift.Equatable {} 455 | extension Beaconstac.LatchLatency : Swift.Hashable {} 456 | extension Beaconstac.LatchLatency : Swift.RawRepresentable {} 457 | @available(*, unavailable, renamed: "Conection") 458 | extension Beaconstac.Reachability.NetworkStatus : Swift.Equatable {} 459 | @available(*, unavailable, renamed: "Conection") 460 | extension Beaconstac.Reachability.NetworkStatus : Swift.Hashable {} 461 | extension Beaconstac.Reachability.Connection : Swift.Equatable {} 462 | extension Beaconstac.Reachability.Connection : Swift.Hashable {} 463 | extension Beaconstac.MNFCTagType : Swift.Equatable {} 464 | extension Beaconstac.MNFCTagType : Swift.Hashable {} 465 | extension Beaconstac.MNFCTagType : Swift.RawRepresentable {} 466 | extension Beaconstac.HardwareState : Swift.Equatable {} 467 | extension Beaconstac.HardwareState : Swift.Hashable {} 468 | extension Beaconstac.HardwareState : Swift.RawRepresentable {} 469 | extension Beaconstac.BeaconHardwareType : Swift.Equatable {} 470 | extension Beaconstac.BeaconHardwareType : Swift.Hashable {} 471 | extension Beaconstac.BeaconHardwareType : Swift.RawRepresentable {} 472 | -------------------------------------------------------------------------------- /Beaconstac/Beaconstac.framework/Modules/Beaconstac.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) 3 | // swift-module-flags: -target x86_64-apple-ios10.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Beaconstac 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import Beaconstac 6 | import CoreBluetooth 7 | import CoreData 8 | import CoreLocation 9 | import CoreNFC 10 | import EddystoneScanner 11 | import Foundation 12 | import SafariServices 13 | import Swift 14 | import SystemConfiguration 15 | import UIKit 16 | import UserNotifications 17 | import _Concurrency 18 | import _StringProcessing 19 | public let BEACONSTAC_SDK_NOTIFICATION_IDENTIFIER: Swift.String 20 | public let BEACONSTAC_SDK_ERROR_DOMAIN: Swift.String 21 | public let BEACONSTAC_SDK_NOTIFICATION_URL_KEY: Swift.String 22 | public let BEACON_REGION_IDENTIFIER: Swift.String 23 | @objc public enum BeaconstacSDKError : Swift.Int { 24 | case SDKNotInitialized = -1001 25 | case BluetoothDisabled = -1002 26 | case LocationPermissionDenied = -1003 27 | case LocationTrackingWhenInUseDenied = -1004 28 | case LocationTrackingAlwaysDenied = -1005 29 | case CannotRangeBeacons = -1006 30 | case UnableToConvertStringToDate = -1007 31 | case UnableToConvertDateToString = -1008 32 | case UnableToCreateURL = -1009 33 | case UnableToCreateWebhookHTTPBody = -1010 34 | case PostingToWebhookFailed = -1011 35 | case NetworkErrorOccurred = -1012 36 | case NotConnectedToInternet = -1013 37 | case CachedDataNotFound = -1014 38 | case UserNotFound = -1015 39 | case InvalidRequest = -1016 40 | public init?(rawValue: Swift.Int) 41 | public typealias RawValue = Swift.Int 42 | public var rawValue: Swift.Int { 43 | get 44 | } 45 | } 46 | @objc public enum iBeaconOption : Swift.Int { 47 | case BackgroundRangeOnDisplayWakeUp 48 | case WhenInUseRange 49 | public init?(rawValue: Swift.Int) 50 | public typealias RawValue = Swift.Int 51 | public var rawValue: Swift.Int { 52 | get 53 | } 54 | } 55 | @objc public enum LatchLatency : Swift.Int64 { 56 | case LOW = 3 57 | case MEDIUM = 5 58 | case HIGH = 7 59 | public init?(rawValue: Swift.Int64) 60 | public typealias RawValue = Swift.Int64 61 | public var rawValue: Swift.Int64 { 62 | get 63 | } 64 | } 65 | @_hasMissingDesignatedInitializers @objc public class Beaconstac : ObjectiveC.NSObject { 66 | @objc weak public var delegate: Beaconstac.BeaconDelegate? { 67 | @objc get 68 | @objc set 69 | } 70 | @objc weak public var ruleDelegate: Beaconstac.RuleProcessorDelegate? { 71 | @objc get 72 | @objc set 73 | } 74 | @objc weak public var notificationDelegate: Beaconstac.NotificationDelegate? { 75 | @objc get 76 | @objc set 77 | } 78 | @objc weak public var webhookDelegate: Beaconstac.WebhookDelegate? { 79 | @objc get 80 | @objc set 81 | } 82 | @objc public var latchLatency: Beaconstac.LatchLatency { 83 | @objc get 84 | @objc set 85 | } 86 | @objc deinit 87 | @objc public class func sharedInstance() throws -> Beaconstac.Beaconstac 88 | @objc public class func sharedInstance(_ token: Swift.String, ibeaconOption: Beaconstac.iBeaconOption = .WhenInUseRange, organization: Foundation.NSNumber? = -1, offlineMode: Swift.Bool = true, delegate: Beaconstac.BeaconDelegate? = nil, completion: @escaping (Beaconstac.Beaconstac?, Swift.Error?) -> ()) 89 | @objc public func startScanningBeacons() 90 | @objc public func stopScanningBeacons() 91 | } 92 | @objc extension Beaconstac.Beaconstac { 93 | @objc dynamic public func notificationOptionsForBeaconstacNotification(_ notification: UserNotifications.UNNotification) -> UserNotifications.UNNotificationPresentationOptions 94 | @objc dynamic public func showCardViewerForLocalNotification(_ notification: UserNotifications.UNNotification) -> Swift.Bool 95 | @objc dynamic public func dismissCardViewer() 96 | } 97 | @objc extension Beaconstac.Beaconstac { 98 | @objc dynamic public func addFilters(_ filters: Swift.Dictionary) 99 | @objc dynamic public func setVisitor(_ visitor: Beaconstac.MVisitor) 100 | } 101 | @_hasMissingDesignatedInitializers @objc public class MRule : ObjectiveC.NSObject { 102 | @objc public var id: Swift.Int64 { 103 | get 104 | } 105 | @objc public var name: Swift.String { 106 | get 107 | } 108 | @objc public var dwellTime: Swift.Int64 { 109 | get 110 | } 111 | @objc public var ruleBy: Swift.String { 112 | get 113 | } 114 | @objc public var triggerEvent: Swift.Int64 { 115 | get 116 | } 117 | @objc public var actions: Swift.Array { 118 | get 119 | } 120 | @objc public var placeNames: [Swift.String]? { 121 | get 122 | } 123 | @objc public func isActive() -> Swift.Bool 124 | @objc deinit 125 | } 126 | @_inheritsConvenienceInitializers @objc(NFCTagEntity) public class NFCTagEntity : CoreData.NSManagedObject { 127 | @objc override dynamic public init(entity: CoreData.NSEntityDescription, insertInto context: CoreData.NSManagedObjectContext?) 128 | @objc deinit 129 | } 130 | @_hasMissingDesignatedInitializers @objc public class MNotification : Beaconstac.MAction { 131 | @objc public var id: Swift.Int64 { 132 | get 133 | } 134 | @objc public var title: Swift.String { 135 | get 136 | } 137 | @objc public var body: Swift.String { 138 | get 139 | } 140 | @objc public var okActionURL: Swift.String? { 141 | get 142 | } 143 | @objc public var markdownCard: Beaconstac.MMarkdownCard? { 144 | get 145 | } 146 | @objc deinit 147 | } 148 | @objc public class MVisitor : ObjectiveC.NSObject { 149 | @objc public var firstName: Swift.String { 150 | get 151 | } 152 | @objc public var lastName: Swift.String { 153 | get 154 | } 155 | @objc public var email: Swift.String? { 156 | get 157 | } 158 | @objc public var age: Foundation.NSNumber? { 159 | get 160 | } 161 | @objc public var gender: Swift.String? { 162 | get 163 | } 164 | @objc public init(_ firstName: Swift.String, lastName: Swift.String, email: Swift.String? = nil, age: Foundation.NSNumber? = nil, gender: Swift.String? = nil) 165 | @objc deinit 166 | } 167 | @objc public protocol BeaconDelegate { 168 | @objc func didFail(_ beaconstac: Beaconstac.Beaconstac, error: Swift.Error) 169 | @objc optional func didEnterRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 170 | @objc optional func didRangeBeacons(_ beaconstac: Beaconstac.Beaconstac, beacons: [Beaconstac.MBeacon]) 171 | @objc optional func campOnBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 172 | @objc optional func exitBeacon(_ beaconstac: Beaconstac.Beaconstac, beacon: Beaconstac.MBeacon) 173 | @objc optional func didExitRegion(_ beaconstac: Beaconstac.Beaconstac, region: Swift.String) 174 | } 175 | @objc public protocol NotificationDelegate { 176 | @objc func overrideNotification(_ beaconstac: Beaconstac.Beaconstac, notification: Beaconstac.MNotification) 177 | } 178 | @objc public protocol WebhookDelegate { 179 | @objc func addParameters(_ beaconstac: Beaconstac.Beaconstac, webhook: Beaconstac.MWebhook) -> Swift.Dictionary 180 | } 181 | @objc public protocol RuleProcessorDelegate { 182 | @objc func willTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 183 | @objc func didTriggerRule(_ beaconstac: Beaconstac.Beaconstac, rule: Beaconstac.MRule) 184 | } 185 | @_inheritsConvenienceInitializers @objc public class MAction : ObjectiveC.NSObject { 186 | @objc override dynamic public init() 187 | @objc deinit 188 | } 189 | public enum ReachabilityError : Swift.Error { 190 | case FailedToCreateWithAddress(Darwin.sockaddr_in) 191 | case FailedToCreateWithHostname(Swift.String) 192 | case UnableToSetCallback 193 | case UnableToSetDispatchQueue 194 | } 195 | @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") 196 | public let ReachabilityChangedNotification: Foundation.NSNotification.Name 197 | extension Foundation.NSNotification.Name { 198 | public static let reachabilityChanged: Foundation.NSNotification.Name 199 | } 200 | public class Reachability { 201 | public typealias NetworkReachable = (Beaconstac.Reachability) -> () 202 | public typealias NetworkUnreachable = (Beaconstac.Reachability) -> () 203 | @available(*, unavailable, renamed: "Conection") 204 | public enum NetworkStatus : Swift.CustomStringConvertible { 205 | case notReachable, reachableViaWiFi, reachableViaWWAN 206 | public var description: Swift.String { 207 | get 208 | } 209 | public static func == (a: Beaconstac.Reachability.NetworkStatus, b: Beaconstac.Reachability.NetworkStatus) -> Swift.Bool 210 | public func hash(into hasher: inout Swift.Hasher) 211 | public var hashValue: Swift.Int { 212 | get 213 | } 214 | } 215 | public enum Connection : Swift.CustomStringConvertible { 216 | case none, wifi, cellular 217 | public var description: Swift.String { 218 | get 219 | } 220 | public static func == (a: Beaconstac.Reachability.Connection, b: Beaconstac.Reachability.Connection) -> Swift.Bool 221 | public func hash(into hasher: inout Swift.Hasher) 222 | public var hashValue: Swift.Int { 223 | get 224 | } 225 | } 226 | public var whenReachable: Beaconstac.Reachability.NetworkReachable? 227 | public var whenUnreachable: Beaconstac.Reachability.NetworkUnreachable? 228 | @available(*, deprecated, renamed: "allowsCellularConnection") 229 | final public let reachableOnWWAN: Swift.Bool 230 | public var allowsCellularConnection: Swift.Bool 231 | public var notificationCenter: Foundation.NotificationCenter 232 | @available(*, deprecated, renamed: "connection.description") 233 | public var currentReachabilityString: Swift.String { 234 | get 235 | } 236 | @available(*, unavailable, renamed: "connection") 237 | public var currentReachabilityStatus: Beaconstac.Reachability.Connection { 238 | get 239 | } 240 | public var connection: Beaconstac.Reachability.Connection { 241 | get 242 | } 243 | required public init(reachabilityRef: SystemConfiguration.SCNetworkReachability) 244 | convenience public init?(hostname: Swift.String) 245 | convenience public init?() 246 | @objc deinit 247 | } 248 | extension Beaconstac.Reachability { 249 | public func startNotifier() throws 250 | public func stopNotifier() 251 | @available(*, deprecated, message: "Please use `connection != .none`") 252 | public var isReachable: Swift.Bool { 253 | get 254 | } 255 | @available(*, deprecated, message: "Please use `connection == .cellular`") 256 | public var isReachableViaWWAN: Swift.Bool { 257 | get 258 | } 259 | @available(*, deprecated, message: "Please use `connection == .wifi`") 260 | public var isReachableViaWiFi: Swift.Bool { 261 | get 262 | } 263 | public var description: Swift.String { 264 | get 265 | } 266 | } 267 | @objc public enum MNFCTagType : Swift.Int { 268 | case unknown = 0 269 | case sticker = 7 270 | case keycard = 8 271 | public init?(rawValue: Swift.Int) 272 | public typealias RawValue = Swift.Int 273 | public var rawValue: Swift.Int { 274 | get 275 | } 276 | } 277 | @_hasMissingDesignatedInitializers @objc public class MNFCTag : ObjectiveC.NSObject { 278 | @objc public var id: Swift.Int64 { 279 | get 280 | } 281 | @objc public var name: Swift.String { 282 | get 283 | } 284 | @objc public var url: Swift.String { 285 | get 286 | } 287 | @objc public var uid: Swift.String { 288 | get 289 | } 290 | @objc public var counter: Swift.Int64 { 291 | get 292 | } 293 | @objc public var state: Beaconstac.HardwareState { 294 | get 295 | } 296 | @objc public var place: Swift.Int64 { 297 | get 298 | } 299 | @objc public var placeName: Swift.String { 300 | get 301 | } 302 | @objc public var tags: [Swift.String] { 303 | get 304 | } 305 | @objc public var type: Beaconstac.MNFCTagType { 306 | get 307 | } 308 | @objc deinit 309 | } 310 | @_hasMissingDesignatedInitializers @objc public class MWebhook : Beaconstac.MAction { 311 | @objc public var id: Swift.Int64 { 312 | get 313 | } 314 | @objc public var name: Swift.String { 315 | get 316 | } 317 | @objc public var url: Swift.String { 318 | get 319 | } 320 | @objc public var status: Swift.String { 321 | get 322 | } 323 | @objc public var params: Swift.Dictionary? { 324 | get 325 | } 326 | @objc deinit 327 | } 328 | @objc public enum HardwareState : Swift.Int { 329 | case active 330 | case sleeping 331 | public init?(rawValue: Swift.Int) 332 | public typealias RawValue = Swift.Int 333 | public var rawValue: Swift.Int { 334 | get 335 | } 336 | } 337 | @objc public enum BeaconHardwareType : Swift.Int { 338 | case unknown 339 | case indoor 340 | case outdoor 341 | case pocket 342 | case keychain 343 | case longrange 344 | case usb 345 | public init?(rawValue: Swift.Int) 346 | public typealias RawValue = Swift.Int 347 | public var rawValue: Swift.Int { 348 | get 349 | } 350 | } 351 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MEddystone : ObjectiveC.NSObject { 352 | @objc public var nid: Swift.String { 353 | get 354 | } 355 | @objc public var bid: Swift.String { 356 | get 357 | } 358 | @objc public var url: Swift.String { 359 | get 360 | } 361 | @objc deinit 362 | } 363 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MHardware : ObjectiveC.NSObject { 364 | @objc public var UUID: Swift.String { 365 | get 366 | } 367 | @objc public var major: Swift.Int64 { 368 | get 369 | } 370 | @objc public var minor: Swift.Int64 { 371 | get 372 | } 373 | @objc public var serialNumber: Swift.String { 374 | get 375 | } 376 | @objc public var mode: Swift.String { 377 | get 378 | } 379 | @objc public var temperature: Swift.Int64 { 380 | get 381 | } 382 | @objc public var battery: Swift.Int64 { 383 | get 384 | } 385 | @objc public var advertisingInterval: Swift.Int64 { 386 | get 387 | } 388 | @objc public var transmissionPower: Swift.Int64 { 389 | get 390 | } 391 | @objc public var firmwareVersion: Swift.String { 392 | get 393 | } 394 | @objc public var type: Beaconstac.BeaconHardwareType { 395 | get 396 | } 397 | @objc public var eddystone: Beaconstac.MEddystone { 398 | get 399 | } 400 | @objc deinit 401 | } 402 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class MBeacon : ObjectiveC.NSObject { 403 | @objc public var id: Swift.Int64 { 404 | get 405 | } 406 | @objc public var name: Swift.String { 407 | get 408 | } 409 | @objc public var isCampedOn: Swift.Bool { 410 | get 411 | } 412 | @objc public var state: Beaconstac.HardwareState { 413 | get 414 | } 415 | @objc public var place: Swift.Int64 { 416 | get 417 | } 418 | @objc public var placeName: Swift.String { 419 | get 420 | } 421 | @objc public var latitude: Swift.Double { 422 | get 423 | } 424 | @objc public var longitude: Swift.Double { 425 | get 426 | } 427 | @objc public var tags: [Swift.String] { 428 | get 429 | } 430 | @objc public var hardware: Beaconstac.MHardware { 431 | get 432 | } 433 | @objc public var latestRSSI: Swift.Int64 434 | @objc deinit 435 | } 436 | @_hasMissingDesignatedInitializers @objc public class MMarkdownCard : ObjectiveC.NSObject { 437 | @objc public var id: Swift.Int64 { 438 | get 439 | } 440 | @objc public var title: Swift.String { 441 | get 442 | } 443 | @objc public var url: Swift.String { 444 | get 445 | } 446 | @objc deinit 447 | } 448 | extension Beaconstac.BeaconstacSDKError : Swift.Equatable {} 449 | extension Beaconstac.BeaconstacSDKError : Swift.Hashable {} 450 | extension Beaconstac.BeaconstacSDKError : Swift.RawRepresentable {} 451 | extension Beaconstac.iBeaconOption : Swift.Equatable {} 452 | extension Beaconstac.iBeaconOption : Swift.Hashable {} 453 | extension Beaconstac.iBeaconOption : Swift.RawRepresentable {} 454 | extension Beaconstac.LatchLatency : Swift.Equatable {} 455 | extension Beaconstac.LatchLatency : Swift.Hashable {} 456 | extension Beaconstac.LatchLatency : Swift.RawRepresentable {} 457 | @available(*, unavailable, renamed: "Conection") 458 | extension Beaconstac.Reachability.NetworkStatus : Swift.Equatable {} 459 | @available(*, unavailable, renamed: "Conection") 460 | extension Beaconstac.Reachability.NetworkStatus : Swift.Hashable {} 461 | extension Beaconstac.Reachability.Connection : Swift.Equatable {} 462 | extension Beaconstac.Reachability.Connection : Swift.Hashable {} 463 | extension Beaconstac.MNFCTagType : Swift.Equatable {} 464 | extension Beaconstac.MNFCTagType : Swift.Hashable {} 465 | extension Beaconstac.MNFCTagType : Swift.RawRepresentable {} 466 | extension Beaconstac.HardwareState : Swift.Equatable {} 467 | extension Beaconstac.HardwareState : Swift.Hashable {} 468 | extension Beaconstac.HardwareState : Swift.RawRepresentable {} 469 | extension Beaconstac.BeaconHardwareType : Swift.Equatable {} 470 | extension Beaconstac.BeaconHardwareType : Swift.Hashable {} 471 | extension Beaconstac.BeaconHardwareType : Swift.RawRepresentable {} 472 | --------------------------------------------------------------------------------