Skip to content

Commit

Permalink
chore: update AbrevvaSDK version; add Makefile for ios test-command
Browse files Browse the repository at this point in the history
fix: test cases
  • Loading branch information
0x7061 committed Aug 22, 2024
1 parent abafe8c commit 45145b1
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 22 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test:
$(MAKE) test-ios

test-ios:
xcodebuild \
-workspace example/ios/ExampleAppExample.xcworkspace \
-scheme ExampleAppExample \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \
test
2 changes: 1 addition & 1 deletion abrevva-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pod::Spec.new do |s|

s.dependency "CocoaMQTT"
s.dependency "CryptoSwift"
s.dependency "AbrevvaSDK", '~> 1.0.20'
s.dependency "AbrevvaSDK", '~> 1.0.23'

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
Expand Down
4 changes: 2 additions & 2 deletions example/ios/ExampleAppExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD = "";
LDPLUSPLUS = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -637,7 +637,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD = "";
LDPLUSPLUS = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
2 changes: 1 addition & 1 deletion example/ios/ExampleAppExampleTests/AbrevvaBleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Quick
import Nimble
import Mockingbird
import CoreBluetooth
@testable import react_native_example_app
import AbrevvaSDK
@testable import abrevva_react_native

final class AbrevvaBleTests: QuickSpec {
override class func spec(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import XCTest
import Quick
import Nimble
import Mockingbird
@testable import react_native_example_app
import AbrevvaSDK
@testable import abrevva_react_native

class RCTPromise{
var data: Any?
Expand Down
1 change: 1 addition & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ target 'ExampleAppExample' do
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "15.0"
end
end
end
Expand Down
32 changes: 23 additions & 9 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- abrevva-react-native (0.1.0):
- AbrevvaSDK (~> 1.0.20)
- AbrevvaSDK (~> 1.0.23)
- CocoaMQTT
- CryptoSwift
- DoubleConversion
Expand All @@ -23,7 +23,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- AbrevvaSDK (1.0.20):
- AbrevvaSDK (1.0.23):
- CocoaMQTT
- CryptoSwift
- boost (1.83.0)
Expand All @@ -32,6 +32,15 @@ PODS:
- CocoaMQTT/Core (2.1.6):
- MqttCocoaAsyncSocket (~> 1.0.8)
- CryptoSwift (1.8.3)
- CwlCatchException (2.2.0):
- CwlCatchExceptionSupport (~> 2.2.0)
- CwlCatchExceptionSupport (2.2.0)
- CwlMachBadInstructionHandler (2.2.0)
- CwlPosixPreconditionTesting (2.2.0)
- CwlPreconditionTesting (2.2.1):
- CwlCatchException (~> 2.2.0)
- CwlMachBadInstructionHandler (~> 2.2.0)
- CwlPosixPreconditionTesting (~> 2.2.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.74.3)
- fmt (9.1.0)
Expand All @@ -41,7 +50,7 @@ PODS:
- hermes-engine/Pre-built (0.74.3)
- MockingbirdFramework (0.20.0)
- MqttCocoaAsyncSocket (1.0.8)
- Nimble (13.3.0):
- Nimble (13.4.0):
- CwlPreconditionTesting (~> 2.2.0)
- Quick (7.6.2)
- RCT-Folly (2024.01.01.00):
Expand Down Expand Up @@ -1205,7 +1214,7 @@ PODS:
- React-utils (= 0.74.3)
- RNFS (2.20.0):
- React-Core
- RNScreens (3.32.0):
- RNScreens (3.34.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1431,19 +1440,24 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
abrevva-react-native: a71c4e72921fc2f516bc32d9818839b48842f02f
AbrevvaSDK: fa79760425864800f524905612f708fa9e323fc5
abrevva-react-native: 9892809596e672fc85a43c42e02d11c22e6e7fe2
AbrevvaSDK: 4edd60273dd1b2d171e8adb5a84756aa5084347c
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
CocoaMQTT: 1f206228b29318eabdacad0c2e4e88575922c27a
CryptoSwift: 967f37cea5a3294d9cce358f78861652155be483
CwlCatchException: 51bf8319009a31104ea6f0568730d1ecc25b6454
CwlCatchExceptionSupport: 1345d6adb01a505933f2bc972dab60dcb9ce3e50
CwlMachBadInstructionHandler: ea1030428925d9bf340882522af30712fb4bf356
CwlPosixPreconditionTesting: a125dee731883f2582715f548c6b6c92c7fde145
CwlPreconditionTesting: ccfd08aca58d14e04062b2a3dd2fd52e09857453
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
hermes-engine: 1f547997900dd0752dc0cc0ae6dd16173c49e09b
MockingbirdFramework: 54e35fbbb47b806c1a1fae2cf3ef99f6eceb55e5
MqttCocoaAsyncSocket: 77d3b74f76228dd5a05d1f9526eab101d415b30c
Nimble: 3ac6c6b0b7e9835d1540b6507d8054b12a415536
Nimble: c3d7c9848a0adae88a665ca52f8da23dd4d2cd94
Quick: b8bec97cd4b9f21da0472d45580f763b801fc353
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: 4c7eeb42be0b2e95195563c49be08d0b839d22b4
Expand Down Expand Up @@ -1494,10 +1508,10 @@ SPEC CHECKSUMS:
React-utils: 6f7ac39d9a0de447d4334bb25d144a28c0c5d8c9
ReactCommon: 4a09c7d8a06e93c1e2e988a3b9f3db3d2449f2fc
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNScreens: fd2722bcc59f36a629205af8cc7b48e4bc0d09f5
RNScreens: db442e7b8c7bc8befec2ce057927305ff8598cc8
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: bd92064a0d558be92786820514d74fc4dddd1233

PODFILE CHECKSUM: c096dde368bb25db14174c2f8e4a6b2095e483e8
PODFILE CHECKSUM: c2b657d91fc21203dd436e57c3a2a27527cbae3b

COCOAPODS: 1.14.3
12 changes: 4 additions & 8 deletions ios/nfc/AbrevvaNfc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ class AbrevvaNfc: NSObject, NFCSessionDelegate {
}

@objc func connect() {
var clientCertArray = getClientCertFromP12File(certName: "client-ios.p12", certPassword: "123")
let clientCertArray = getClientCertFromP12File(certName: "client-ios.p12", certPassword: "123")

self.clientID = CLIENTID

mqtt5Client = MQTT5Client(clientID: clientID, host: HOST, port: PORT, clientCertArray:clientCertArray)
mqtt5Client?.setOnMessageRecieveHandler(handler: onMessageRecieveHandler)
mqtt5Client?.setDidStateChangeToHandler(handler: didStateChangeToHandler)


mqtt5Client?.connect()

}

@objc func disconnect() {
Expand Down Expand Up @@ -109,18 +107,16 @@ class AbrevvaNfc: NSObject, NFCSessionDelegate {
}

func sessionDidStart(_ withSuccess: Bool) {

}

func sessionDidClose(_ withError: (any Error)?) {

}

func sessionDidReceiveKeyOnEvent(_ tagID: Data, _ historicalBytes: Data) {
mqtt5Client?.publishKyOn(identifier: tagID, historicalBytes: historicalBytes)
mqtt5Client?.publishKyOn(identifier: tagID.toHexString(), historicalBytes: historicalBytes.toHexString())
}

func sessionDidReceiveKeyOffEvent(_ tagID: Data, _ historicalBytes: Data) {
mqtt5Client?.publishKyOff(identifier: tagID, historicalBytes: historicalBytes)
mqtt5Client?.publishKyOff(identifier: tagID.toHexString(), historicalBytes: historicalBytes.toHexString())
}
}

0 comments on commit 45145b1

Please sign in to comment.