diff --git a/README.md b/README.md index 477fec26..c618092b 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Kontakt.io SDK Versions of newest release: | OS | SDK Version | | :---------- | :--------------------------------------------------------------------------------------------------- | -| **Android** | [7.0.6](https://kontakt-api-docs.stoplight.io/docs/dev-ctr-sdks/423dcaf4067cc-android-sdk-changelog) | -| **iOS** | [3.0.25](https://github.com/kontaktio/kontakt-ios-sdk/releases/tag/v3.0.25) | +| **Android** | [7.2.23](https://kontakt-api-docs.stoplight.io/docs/dev-ctr-sdks/423dcaf4067cc-android-sdk-changelog#version-7223) | +| **iOS** | [3.1.0](https://github.com/kontaktio/kontakt-ios-sdk/releases/tag/3.1.0) | ## Advantages @@ -203,28 +203,28 @@ export default App; **Note (March 2020)**: The example in the `Example/` folder is a bit outdated. If you want to try to run the example app anyway, here are some instructions to do so: -1. Clone this repository, connect an Android and/or Apple device to your computer and have some (Kontakt.io) beacons nearby. +1. Clone this repository, connect an Android and/or Apple device to your computer and have some (Kontakt.io) beacons nearby. -2. Open a terminal window, bash to the `Example/` folder, run `npm install` and start the react-native server +2. Open a terminal window, bash to the `Example/` folder, run `npm install` and start the react-native server ```bash - $ cd react-native-kontaktio/Example - $ npm install - $ npm start + cd react-native-kontaktio/Example + npm install + npm start ``` -3. Build the example and run it on your device. The app will appear under the name `KontaktIoSimpleTest`: +3. Build the example and run it on your device. The app will appear under the name `KontaktIoSimpleTest`: - Android: ```bash - $ react-native run-android + react-native run-android ``` - iOS ```bash - $ react-native run-ios + react-native run-ios ``` ## Further notes @@ -232,14 +232,14 @@ export default App; - Beacons support is part of Android versions 4.3 and up. \* So far the lowest Android version this library was tested on was a device with Android 4.4.2. - A physical device must be used for testing and some beacons (Kontakt.io beacons to be able to use all features). - If some BLE Beacons are filtered out by the scan on Android 12+, therefore not returned in the list of beacons, try this: + ```xml ``` - With the **neverForLocation** android:usesPermissionFlags, some BLE beacons are filtered from the scan results. |More information about this on [issue #121](https://github.com/Driversnote-Dev/react-native-kontaktio/issues/121#issuecomment-2098884380). - + With the **neverForLocation** android:usesPermissionFlags, some BLE beacons are filtered from the scan results. |More information about this on [issue #121](https://github.com/Driversnote-Dev/react-native-kontaktio/issues/121#issuecomment-2098884380). -## ToDo: +## ToDo - Update Android Eddystone feature: @@ -262,6 +262,7 @@ export default App; "react-native-kontaktio": "../react-native-kontaktio" }, ``` + 6. Build and run on a real device ### Upgrade to a new version of the Kontakt.io SDK diff --git a/android/build.gradle b/android/build.gradle index fb0a67df..61e87bc7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -112,5 +112,5 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "androidx.appcompat:appcompat:1.3.1" implementation "com.facebook.react:react-native:+" // From node_modules - implementation "io.kontakt.mvn:sdk:7.0.6" + implementation "io.kontakt.mvn:sdk:7.2.23" } diff --git a/ios/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h b/ios/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h index 2b30ef99..d924e74f 100644 --- a/ios/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h +++ b/ios/KontaktSDK.framework/Headers/CLBeacon+Kontakt.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2016 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKAction.h b/ios/KontaktSDK.framework/Headers/KTKAction.h index 51cdf113..bd89d029 100644 --- a/ios/KontaktSDK.framework/Headers/KTKAction.h +++ b/ios/KontaktSDK.framework/Headers/KTKAction.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKActionContent.h b/ios/KontaktSDK.framework/Headers/KTKActionContent.h index 12eb4ab3..235647cc 100644 --- a/ios/KontaktSDK.framework/Headers/KTKActionContent.h +++ b/ios/KontaktSDK.framework/Headers/KTKActionContent.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKBeaconManager.h b/ios/KontaktSDK.framework/Headers/KTKBeaconManager.h index 7d0b6155..cefa32a1 100644 --- a/ios/KontaktSDK.framework/Headers/KTKBeaconManager.h +++ b/ios/KontaktSDK.framework/Headers/KTKBeaconManager.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKBeaconRegion.h b/ios/KontaktSDK.framework/Headers/KTKBeaconRegion.h index 5c26d82d..e20f6194 100644 --- a/ios/KontaktSDK.framework/Headers/KTKBeaconRegion.h +++ b/ios/KontaktSDK.framework/Headers/KTKBeaconRegion.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKCloudClient.h b/ios/KontaktSDK.framework/Headers/KTKCloudClient.h index df7e06c2..d9554bde 100644 --- a/ios/KontaktSDK.framework/Headers/KTKCloudClient.h +++ b/ios/KontaktSDK.framework/Headers/KTKCloudClient.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKCloudDefinitions.h b/ios/KontaktSDK.framework/Headers/KTKCloudDefinitions.h index 15b475cd..4c16e435 100644 --- a/ios/KontaktSDK.framework/Headers/KTKCloudDefinitions.h +++ b/ios/KontaktSDK.framework/Headers/KTKCloudDefinitions.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKCloudModel.h b/ios/KontaktSDK.framework/Headers/KTKCloudModel.h index f00928c4..d2ab2521 100644 --- a/ios/KontaktSDK.framework/Headers/KTKCloudModel.h +++ b/ios/KontaktSDK.framework/Headers/KTKCloudModel.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDevice.h b/ios/KontaktSDK.framework/Headers/KTKDevice.h index e2ce8ff8..c061a102 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDevice.h +++ b/ios/KontaktSDK.framework/Headers/KTKDevice.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -81,6 +81,21 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, strong, readonly) NSString *orderID; +/** + * Filtration Mask of the device. (read-only) + */ +@property (nonatomic, assign, readonly) KTKDeviceFilteringClass filtrationMask; + +/** + * Ble Scan Channel of the device. (read-only) + */ +@property (nonatomic, assign, readonly) KTKDeviceBLEChannel bleScanChannel; + +/** + * WIFI SSID of the device. (read-only) + */ +@property (nonatomic, strong, readonly) NSString *wifiSSID; + /** * Device type. (read-only) * diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h b/ios/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h index 5fc0b65e..3a1e2fbb 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceConfiguration.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -165,6 +165,35 @@ __attribute__((deprecated("Please use `packets` property instead"))); //@property (nonatomic, strong, readwrite) NSArray * _Nullable footfallLine; @property (nonatomic, copy, readwrite) NSString * _Nullable footfallLine; + +/** + * Bluetooth blink Interval value. + * + * This property can be used Blink time for IR emitter, in seconds. 0 - disabled. Default: 2 (s) + */ +@property (nonatomic, strong, readwrite) NSNumber * _Nullable blinkInterval; + +/** + * Bluetooth ir detection interval value. + * + * This property can be used to set seconds to sleep between detection attempts. Default: 5 (s) + */ +@property (nonatomic, strong, readwrite) NSNumber * _Nullable irDetectionInterval; + +/** + * Bluetooth ir detection duration value. + * + * This property can be used to set seconds to try and detect the IR signal, before going to sleep again. Default: 2 (s) + */ +@property (nonatomic, strong, readwrite) NSNumber * _Nullable irDetectionDuration; + +/** + * Bluetooth ir detection sleep value. + * + * This property can be used to set seconds 0: disabled, 1: enabled. Default: 1 + */ +@property (nonatomic, strong, readwrite) NSNumber * _Nullable irDetectionSleep; + /** * Bluetooth Scan interval value. * diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h b/ios/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h index 518bf103..f5349752 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceConfigurationGPIO.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2018 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceConnection.h b/ios/KontaktSDK.framework/Headers/KTKDeviceConnection.h index fc6aef0d..e6372de1 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceConnection.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceConnection.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -186,12 +186,19 @@ typedef void (^KTKDeviceConnectionUpdateCompletion)(BOOL synchronized, NSError * - (void)readConfigurationWithCompletion:(KTKDeviceConnectionReadCompletion)completion; /** - * Synch the tocken from the connection device. + * Send the current time to the connected device. + * + * @param completion A block object to be executed when the write operation finishes. + */ +- (void)syncTimeWithCompletion: (void (^)(NSError * _Nullable))completion; + +/** + * Synch the token from the connection device. * * @param firmware The version firmware object for update device * @param completion A block object to be executed when the read operation finishes. */ -- (void)synchDeviceConfigurationWithCompletion: (void (^)(__kindof KTKDeviceConfiguration * _Nullable, NSString *firmware, NSError * _Nullable))completion ; +- (void)synchDeviceConfigurationWithCompletion: (void (^)(__kindof KTKDeviceConfiguration * _Nullable, NSString *firmware, NSError * _Nullable))completion; /** * Listens for sensors updates from the connection device. diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceCredentials.h b/ios/KontaktSDK.framework/Headers/KTKDeviceCredentials.h index 7cf2d25c..48122efe 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceCredentials.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceCredentials.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h b/ios/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h index 5dcf6d0e..5025ec07 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceDataLoggerReading.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h b/ios/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h index 882dd1d0..767a93eb 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceDefinitions.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -307,6 +307,11 @@ typedef NS_OPTIONS(NSInteger, KTKDeviceTelemetryFields) { */ KTKDeviceTelemetryFieldsPeopleDetection = 1 << 29, + /** + * RSSI Scan. + */ + KTKDeviceTelemetryFieldsRSSIScan = 1 << 30, + /** * All supprted packets. */ @@ -494,13 +499,37 @@ typedef NS_ENUM(NSInteger, KTKDeviceModel) { */ KTKDeviceModelNanoSeries = 32, /** - * Asset Tag + * Asset Tag 2 */ KTKDeviceModelAssetTag2 = 33, /** * Anchor Beacon */ KTKDeviceModelAnchorBeacon2 = 34, + /** + * Mini Beam + */ + KTKDeviceModelMiniBeam = 35, + /** + * Portal Beam IR + */ + KTKDeviceModelPortalBeamIR = 36, + /** + * Dispenser Beacon + */ + KTKDeviceModelDispenserBeacon = 37, + /** + * Portal Light 2S + */ + KTKDeviceModelPortalLight2S = 38, + /** + * Portal Light 2 + */ + KTKDeviceModelPortalLight2 = 39, + /** + * Asset Tag 2 Mini + */ + KTKDeviceModelAssetTag2Mini = 40, /** * Partner provided name @@ -547,10 +576,65 @@ typedef NS_ENUM(NSInteger, KTKDeviceSymbol) { KTKDeviceSymbolNASE_1 = 32, KTKDeviceSymbolAST_2 = 33, KTKDeviceSymbolANB_2 = 34, + KTKDeviceSymbolMB = 35, + KTKDeviceSymbolPB_IR = 36, + KTKDeviceSymbolDB = 37, + KTKDeviceSymbolPL_2S = 38, + KTKDeviceSymbolPL_2 = 39, + KTKDeviceSymbolAST_2_M = 40, KTKDeviceSymbolPD = 128 }; +/** + * A kontakt device channels status. + */ +typedef NS_ENUM(NSInteger, KTKDeviceBLEChannel) { + /** + * Channel is unknown. + */ + KTKDeviceBLEChannelUknown = -1, + /** + * Device supported all channels. + */ + KTKDeviceBLEChannelALL = 0, + /** + * Device status is channel 37. + */ + KTKDeviceBLEChannel37 = 37, + /** + * Device status is channel 38. + */ + KTKDeviceBLEChannel38 = 38, + + /** + * Device status is channel 39. + */ + KTKDeviceBLEChannel39 = 39 +}; + +/** + * A kontakt device filtering Class. + */ +typedef NS_ENUM(NSInteger, KTKDeviceFilteringClass) { + /** + * Class is unknown. + */ + KTKDeviceFilteringClassUknown = -1, + /** + * Device status flitering class Kontakt. + */ + KTKDeviceFilteringClassKtk = 1, + /** + * Device status flitering class iBeacon, Eddystone, Kontakt . + */ + KTKDeviceFilteringClassIbEidKtk = 7, + /** + * Device supported all classes. + */ + KTKDeviceFilteringClassALL = 15 +}; + /** * A kontakt device shuffle status. */ @@ -671,7 +755,6 @@ typedef NS_ENUM(NSInteger, KTKDeviceOccupancyModel) { KTKDeviceOccupancyModeFootfallCorridor = 3 }; - /** * A device data logger fields. */ diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConfiguration.h b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConfiguration.h index 50f03383..b98044b2 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConfiguration.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConfiguration.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h index 1d2be271..c1a02e82 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayConnection.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // @@ -8,6 +8,7 @@ #import "KTKDeviceConnection.h" #import "KTKDeviceGatewayWiFiNetwork.h" #import "KTKDeviceGatewayConfiguration.h" +#import "KTKDeviceGatewayDiagnostic.h" NS_ASSUME_NONNULL_BEGIN @@ -21,8 +22,26 @@ NS_ASSUME_NONNULL_BEGIN * @param error An error object containing the error that indicates why the operation failed. */ typedef void (^KTKDeviceGatewayConnectionGetWiFiBlock)(NSSet * _Nullable networks, __kindof KTKDeviceGatewayConfiguration * _Nullable configuration, NSError * _Nullable error); + +/** + * A completion block object to be executed when the reading mac networks operation finishes. + * + * @param networks Set of mac networks visible by the Gateway. + * @param configuration The configuration object. Result of the read operation. + * @param error An error object containing the error that indicates why the operation failed. + */ typedef void (^KTKDeviceGatewayConnectionGetMACBlock)(NSString * _Nullable mac, NSError * _Nullable error); +/** + * A completion block object to be executed when the reading diagnostic networks operation finishes. + * + * @param networks Set of diagnostic networks visible by the Gateway. + * @param configuration The configuration object. Result of the read operation. + * @param error An error object containing the error that indicates why the operation failed. + */ +typedef void (^KTKDeviceGatewayConnectionGetDiagnosticBlock)(KTKDeviceGatewayDiagnostic * _Nullable gatewayDiagnostic, NSError * _Nullable error); + + #pragma mark - KTKDeviceGatewayConnection (Interface) @interface KTKDeviceGatewayConnection : KTKDeviceConnection @@ -47,6 +66,20 @@ typedef void (^KTKDeviceGatewayConnectionGetMACBlock)(NSString * _Nullable mac, */ - (void)getMacDevice:(KTKDeviceGatewayConnectionGetMACBlock)completion; + +/** + * Blink device + * + * @param completion A block object to be executed when the read operation finishes. + */ +- (void)getBlinkDevice:(KTKDeviceGatewayConnectionGetMACBlock)completion; +/** + * Reads the configuration from the connection device using MAC. + * + * @param completion A block object to be executed when the read operation finishes. + */ +- (void)getDiagnosticDevice:(KTKDeviceGatewayConnectionGetDiagnosticBlock)completion; + @end NS_ASSUME_NONNULL_END diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayDiagnostic.h b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayDiagnostic.h new file mode 100644 index 00000000..6bfbc204 --- /dev/null +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayDiagnostic.h @@ -0,0 +1,61 @@ +// +// KontaktSDK +// Version: 3.1.0 +// +// Copyright © 2021 Kontakt.io. All rights reserved. +// + +@import Foundation; +#import "KTKDeviceGatewayConfiguration.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(uint8_t, KTKKontaktGatewayDiagnosticCommand) { + KTKKontaktGatewayDiagnosticCommandDiagnostinc = 0x01, +}; + + +#pragma mark - KTKDeviceGatewayDiagnostic (Interface) +@interface KTKDeviceGatewayDiagnostic : NSObject + +#pragma mark - Initialization Methods +///-------------------------------------------------------------------- +/// @name Initialization Methods +///-------------------------------------------------------------------- + +- (void)updateDiagnosticData:(NSData *)serviceData; + +#pragma mark - Diagnostic Properties +///-------------------------------------------------------------------- +/// @name Diagnostic +///-------------------------------------------------------------------- + +@property (nonatomic, readonly, assign, getter=isAPIConnection) BOOL aPIConnection; + +@property (nonatomic, readonly, assign, getter=isEventCollectConnection) BOOL eventCollectConnection; + +@property (nonatomic, readonly, copy) NSString * iPAddress; + +@property (nonatomic, readonly, assign, getter=isTimeSynchronization) BOOL timeSynchronization; + +@property (nonatomic, readonly, assign, getter=isConnectedToWiFi) BOOL connectedToWiFi; + +@property (nonatomic, readonly, assign, getter=isFallbackNetworkConnected) BOOL fallbackNetworkConnected; + +@property (nonatomic, readonly, assign, getter=isMainNetworkVisible) BOOL mainNetworkVisible; + +@property (nonatomic, readonly, assign) NSInteger mainNetworkRSSI; + +@property (nonatomic, readonly, assign, getter=isFallbackNetworkVisible) BOOL fallbackNetworkVisible; + +@property (nonatomic, readonly, assign) NSInteger fallbackNetworkRSSI; + +@property (nonatomic, readonly, assign, getter=isNearbyNetworks) BOOL nearbyNetworks; + +@property (nonatomic, readonly, assign, getter=isProvision) BOOL provision; + + +@end + +NS_ASSUME_NONNULL_END + diff --git a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h index e2a62663..37240ca4 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h +++ b/ios/KontaktSDK.framework/Headers/KTKDeviceGatewayWiFiNetwork.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // @@ -12,15 +12,22 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - typedef NS_OPTIONS(NSInteger, KTKDeviceGatewayWiFiNetworkType) { - KTKDeviceGatewayWiFiNetworkTypeUnknown = 0, + KTKDeviceGatewayWiFiNetworkTypeUnknown = 0, KTKDeviceGatewayWiFiNetworkTypeOpen = 1 << 0, KTKDeviceGatewayWiFiNetworkTypeWEP = 1 << 1, KTKDeviceGatewayWiFiNetworkTypePersonalWPA = 1 << 2, KTKDeviceGatewayWiFiNetworkTypeEnterpriseWPA = 1 << 3, KTKDeviceGatewayWiFiNetworkTypePersonalWPA2 = 1 << 4, KTKDeviceGatewayWiFiNetworkTypeEnterpriseWPA2 = 1 << 5, + KTKDeviceGatewayWiFiNetworkTypePersonalWPA3 = 1 << 6, + KTKDeviceGatewayWiFiNetworkTypeEnterpriseWPA3 = 1 << 7, }; +typedef NS_ENUM(uint8_t, KTKDeviceGatewayWiFiNetworkCommand) { + KTKKontaktGatewayDiagnosticCommandWIFI = 0x00 +}; + + #pragma mark - KTKDeviceGatewayWiFiNetwork (Interface) @interface KTKDeviceGatewayWiFiNetwork : NSObject @@ -31,6 +38,8 @@ typedef NS_OPTIONS(NSInteger, KTKDeviceGatewayWiFiNetworkType) { - (instancetype)initWithName:(NSString*)name; +- (BOOL)updateData:(NSData *)serviceData; + #pragma mark - Network Properties ///-------------------------------------------------------------------- /// @name Network Properties @@ -38,7 +47,7 @@ typedef NS_OPTIONS(NSInteger, KTKDeviceGatewayWiFiNetworkType) { @property (nonatomic, readonly, strong) NSString *networkSSID; -@property (nonatomic, readonly, assign) NSUInteger signalStrength; +@property (nonatomic, readonly, assign) NSInteger signalStrength; @property (nonatomic, readonly, assign) KTKDeviceGatewayWiFiNetworkType type; diff --git a/ios/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h b/ios/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h index 81ccf47b..f51e27ef 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h +++ b/ios/KontaktSDK.framework/Headers/KTKDevicePowerSaving.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2016 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKDevicesManager.h b/ios/KontaktSDK.framework/Headers/KTKDevicesManager.h index 7fcb0238..9658f798 100644 --- a/ios/KontaktSDK.framework/Headers/KTKDevicesManager.h +++ b/ios/KontaktSDK.framework/Headers/KTKDevicesManager.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystone.h b/ios/KontaktSDK.framework/Headers/KTKEddystone.h index efbf3c2d..00c4678c 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystone.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystone.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneFrame.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneFrame.h index 61061146..9dc4ecfb 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneFrame.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneFrame.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneManager.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneManager.h index e00a56a9..16f517d0 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneManager.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneManager.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneRegion.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneRegion.h index ec69e8bc..9b658199 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneRegion.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneRegion.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneTLM.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneTLM.h index 80939401..a7508505 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneTLM.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneTLM.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneUID.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneUID.h index 06e8b6f2..e879fc4c 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneUID.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneUID.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKEddystoneURL.h b/ios/KontaktSDK.framework/Headers/KTKEddystoneURL.h index 99c55781..1ca2a903 100644 --- a/ios/KontaktSDK.framework/Headers/KTKEddystoneURL.h +++ b/ios/KontaktSDK.framework/Headers/KTKEddystoneURL.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKFirmware.h b/ios/KontaktSDK.framework/Headers/KTKFirmware.h index e850bb57..81b039d8 100644 --- a/ios/KontaktSDK.framework/Headers/KTKFirmware.h +++ b/ios/KontaktSDK.framework/Headers/KTKFirmware.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKKontaktResponse.h b/ios/KontaktSDK.framework/Headers/KTKKontaktResponse.h index a748796a..72b68537 100644 --- a/ios/KontaktSDK.framework/Headers/KTKKontaktResponse.h +++ b/ios/KontaktSDK.framework/Headers/KTKKontaktResponse.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -38,6 +38,11 @@ typedef void (^KTKKontaktResponseCompletionBlock)(KTKKontaktResponse * _Nullable */ @property (nonatomic, assign, readonly) NSUInteger maxResult; +/** + * The count of the all objects. + */ +@property (nonatomic, assign, readonly) NSUInteger allCount; + /** * The count of the received objects. */ diff --git a/ios/KontaktSDK.framework/Headers/KTKManager.h b/ios/KontaktSDK.framework/Headers/KTKManager.h index 13c2feed..0211b624 100644 --- a/ios/KontaktSDK.framework/Headers/KTKManager.h +++ b/ios/KontaktSDK.framework/Headers/KTKManager.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -116,6 +116,11 @@ typedef NS_OPTIONS(NSUInteger, KTKManagerSubscriptionPlan) { */ @property (nonatomic, assign, readonly) KTKManagerSubscriptionPlan subscriptionPlan; +/** + * An devices count. (read-only) + */ +@property (nonatomic, strong, readonly) NSNumber *deviceCount; + @end NS_ASSUME_NONNULL_END diff --git a/ios/KontaktSDK.framework/Headers/KTKNearbyDevice.h b/ios/KontaktSDK.framework/Headers/KTKNearbyDevice.h index 371b4741..8e745ae7 100644 --- a/ios/KontaktSDK.framework/Headers/KTKNearbyDevice.h +++ b/ios/KontaktSDK.framework/Headers/KTKNearbyDevice.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @@ -10,6 +10,7 @@ #import "KTKDeviceDefinitions.h" #import "KTKNearbyDeviceTelemetry.h" +#import "KTKKontaktResponse.h" NS_ASSUME_NONNULL_BEGIN @@ -128,6 +129,15 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, assign) double updatedAt; + +/** + * Updates force a nearby device object with the specified advertisement dictionary. + * + */ +- (void)setUpdatedForceCompletion:(KTKKontaktResponseCompletionBlock)completion; + @end + + NS_ASSUME_NONNULL_END diff --git a/ios/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h b/ios/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h index 23961ac3..2ff119fa 100644 --- a/ios/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h +++ b/ios/KontaktSDK.framework/Headers/KTKNearbyDeviceTelemetry.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // @@ -23,6 +23,36 @@ typedef NS_ENUM(uint8_t, KTKDeviceDataLoggerStatus) { KTKDeviceDataLoggerStatusEnabled, }; +/** + * A device gas typ fields. + */ +typedef NS_OPTIONS(uint8_t, KTKDeviceGasTypFields) { + KTKDeviceGasTypGenericPPM = 0x00, + KTKDeviceGasTypCarbonMonoxide = 0x01, + KTKDeviceGasTypEthanol = 0x02, + KTKDeviceGasTypVolatileOrganicCompounds = 0x03, + KTKDeviceGasTypPM1_0 = 0x04, + KTKDeviceGasTypPM2_5 = 0x05, + KTKDeviceGasTypPM10_0 = 0x06, + KTKDeviceGasTypCarbonDioxide = 0x07, + KTKDeviceGasTypGasResistance = 0x08 +}; + +/** + * A device Status Soapfields. + */ +typedef NS_OPTIONS(uint8_t, KTKDeviceStatusSoapFields) { + KTKDeviceStatusSoapFieldsNoEOS = 1 << 0, + KTKDeviceStatusSoapFieldsNoEkeyCommunication = 1 << 1, + KTKDeviceStatusSoapFieldsWrongEkey = 1 << 2, + KTKDeviceStatusSoapFieldsIncomplete = 1 << 3, + KTKDeviceStatusSoapFieldsLowBackupBattery = 1 << 4, + KTKDeviceStatusSoapFieldsFaultDue = 1 << 5, + KTKDeviceStatusSoapFieldsLowRefill = 1 << 6, + KTKDeviceStatusSoapFieldsLockoutStatus = 1 << 7, +}; + + NS_ASSUME_NONNULL_BEGIN #pragma mark - KTKNearbyDeviceTelemetry (Interface) @@ -35,6 +65,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly, copy) NSString * _Nullable uniqueID; + @property (nonatomic, readonly, copy) NSNumber * _Nullable channel; #pragma mark - Basic System Health @@ -235,6 +266,90 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, copy) NSNumber * _Nullable airQuality; +/** + * Measured distance in [cm]. (read-only) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable distance; + +/** + * Accurancy 0-100%. (read-only) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable accuracy; + +/** + * Gas type. (read-only) + * + * 0x00 Generic ppm + * 0x01 Carbon Monoxide ppm + * 0x02 Ethanol Monoxide ppm + * 0x03 Volatile Organic Compounds ppm + * 0x04 PM 1.0 ug/m3 + * 0x05 PM 2.5 ug/m3 + * 0x06 PM 10.0 ug/m3 + * 0x07 Carbon Dioxide ppm + * 0x08 Gas resistance kOhm + */ + +@property (nonatomic, readonly, assign) KTKDeviceGasTypFields gasTypeFields; + +/** + * Signed, 16-bit PPM concentration, can be a positive PPM, or a difference from baseline. (read-only) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable gasPPM; + +/** + * Unsigned, 16-bit light level measured in lux. (read-only) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable lightLevelLux; + + +// Soap Dispenser +/** + * Serial number + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable serialNumber; + +/** + * Charge + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable charge; + +/** + * Activations (/1k) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable activationsCount; + +/** + * Activations (kontakt) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable activationsKontakt; + +/** + * Refills + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable refills; + +/** + * Status + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable statusSoap; + +/** + * Status Soap Fields (read-only) + */ +@property (nonatomic, readonly, assign) KTKDeviceStatusSoapFields statusSoapFields; + +/** + * Config + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable configSoap; + +/** + * Distributor + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable distributor; + + #pragma mark - Scanning ///-------------------------------------------------------------------- /// @name Scanning @@ -265,6 +380,26 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, copy) NSNumber * _Nullable wifiScans; +///-------------------------------------------------------------------- +/// @name RSSI scan +///-------------------------------------------------------------------- + +/** + * Scan ID - counter that identifies the current scan from the previous ones. (read-only) + */ +@property (nonatomic, readonly, copy) NSNumber * _Nullable scanID; + +/** + * MAC address. (read-only) + */ +@property (nonatomic, readonly, copy) NSString * _Nullable mac; + +/** + * RSSI values. Zero (0x00) if not present. The values are in chronological order, as they are scanned. Above 6 values, they are discarded. + */ +@property (nonatomic, readonly, copy) NSArray * _Nullable rssiValues; + + #pragma mark - Data Logger ///-------------------------------------------------------------------- diff --git a/ios/KontaktSDK.framework/Headers/KTKPersonPosition.h b/ios/KontaktSDK.framework/Headers/KTKPersonPosition.h index 5c989637..614c9ea3 100644 --- a/ios/KontaktSDK.framework/Headers/KTKPersonPosition.h +++ b/ios/KontaktSDK.framework/Headers/KTKPersonPosition.h @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign, readonly) NSUInteger y; - (nullable instancetype)initWithData:(NSData * _Nullable)data; +- (nullable instancetype)init: (NSUInteger) y : (NSUInteger)x; @end diff --git a/ios/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h b/ios/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h index 7a6000d8..da2e52e4 100644 --- a/ios/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h +++ b/ios/KontaktSDK.framework/Headers/KTKSecureBeaconRegion.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h b/ios/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h index 62c51c72..3274ba96 100644 --- a/ios/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h +++ b/ios/KontaktSDK.framework/Headers/KTKSecureEddystoneRegion.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKTrigger.h b/ios/KontaktSDK.framework/Headers/KTKTrigger.h index 8ffd3bc8..a768a1cf 100644 --- a/ios/KontaktSDK.framework/Headers/KTKTrigger.h +++ b/ios/KontaktSDK.framework/Headers/KTKTrigger.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKTriggerContext.h b/ios/KontaktSDK.framework/Headers/KTKTriggerContext.h index 39a5b984..1304afa5 100644 --- a/ios/KontaktSDK.framework/Headers/KTKTriggerContext.h +++ b/ios/KontaktSDK.framework/Headers/KTKTriggerContext.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2017 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KTKVenue.h b/ios/KontaktSDK.framework/Headers/KTKVenue.h index 751ad9c8..279c8a8b 100644 --- a/ios/KontaktSDK.framework/Headers/KTKVenue.h +++ b/ios/KontaktSDK.framework/Headers/KTKVenue.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright © 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/Kontakt.h b/ios/KontaktSDK.framework/Headers/Kontakt.h index 204b2549..81829615 100644 --- a/ios/KontaktSDK.framework/Headers/Kontakt.h +++ b/ios/KontaktSDK.framework/Headers/Kontakt.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/KontaktSDK.h b/ios/KontaktSDK.framework/Headers/KontaktSDK.h index a55a7865..886d4d0e 100644 --- a/ios/KontaktSDK.framework/Headers/KontaktSDK.h +++ b/ios/KontaktSDK.framework/Headers/KontaktSDK.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/NSData+Kontakt.h b/ios/KontaktSDK.framework/Headers/NSData+Kontakt.h index 84f8880d..536ee20b 100644 --- a/ios/KontaktSDK.framework/Headers/NSData+Kontakt.h +++ b/ios/KontaktSDK.framework/Headers/NSData+Kontakt.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Headers/NSString+Kontakt.h b/ios/KontaktSDK.framework/Headers/NSString+Kontakt.h index 17a9a5e1..6beddba4 100644 --- a/ios/KontaktSDK.framework/Headers/NSString+Kontakt.h +++ b/ios/KontaktSDK.framework/Headers/NSString+Kontakt.h @@ -1,6 +1,6 @@ // // KontaktSDK -// Version: 3.0.25 +// Version: 3.1.0 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // diff --git a/ios/KontaktSDK.framework/Info.plist b/ios/KontaktSDK.framework/Info.plist index 6a52c457..db9376cb 100644 Binary files a/ios/KontaktSDK.framework/Info.plist and b/ios/KontaktSDK.framework/Info.plist differ diff --git a/ios/KontaktSDK.framework/KontaktSDK b/ios/KontaktSDK.framework/KontaktSDK index 12ece95b..dce23e9c 100755 Binary files a/ios/KontaktSDK.framework/KontaktSDK and b/ios/KontaktSDK.framework/KontaktSDK differ diff --git a/ios/KontaktSDK.framework/Modules/module.modulemap b/ios/KontaktSDK.framework/Modules/module.modulemap index c94535e0..838ffd36 100644 --- a/ios/KontaktSDK.framework/Modules/module.modulemap +++ b/ios/KontaktSDK.framework/Modules/module.modulemap @@ -1,6 +1,6 @@ framework module KontaktSDK { umbrella header "KontaktSDK.h" - export * + module * { export * } } diff --git a/ios/KontaktSDK.framework/en.lproj/Localizable.strings b/ios/KontaktSDK.framework/en.lproj/Localizable.strings deleted file mode 100644 index ca361c7c..00000000 Binary files a/ios/KontaktSDK.framework/en.lproj/Localizable.strings and /dev/null differ diff --git a/ios/KontaktSDK.framework/strip-frameworks.sh b/ios/KontaktSDK.framework/strip-frameworks.sh new file mode 100644 index 00000000..80814abb --- /dev/null +++ b/ios/KontaktSDK.framework/strip-frameworks.sh @@ -0,0 +1,72 @@ +################################################################################ +# +# Copyright 2015 Realm Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# This script strips all non-valid architectures from dynamic libraries in +# the application's `Frameworks` directory. +# +# The following environment variables are required: +# +# BUILT_PRODUCTS_DIR +# FRAMEWORKS_FOLDER_PATH +# VALID_ARCHS +# EXPANDED_CODE_SIGN_IDENTITY + + +# Signs a framework with the provided identity +code_sign() { + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" +} + +# Set working directory to product’s embedded frameworks +cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +if [ "$ACTION" = "install" ]; then + echo "Copy .bcsymbolmap files to .xcarchive" + find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \; +else + # Delete *.bcsymbolmap files from framework bundle unless archiving + find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\; +fi + +echo "Stripping frameworks" + +for file in $(find . -type f -perm +111); do + # Skip non-dynamic libraries + if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then + continue + fi + # Get architectures for current file + archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$file" "$file" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" != "" ]]; then + echo "Stripped $file of architectures:$stripped" + if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then + code_sign "${file}" + fi + fi +done