Skip to content

Commit 3f268ea

Browse files
committed
Test commit for checking callback logic.
1 parent 24057ad commit 3f268ea

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

SDKIntegrationTestApps/Source/iOSReleaseTestTests.swift

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ final class iOSReleaseTestTests: XCTestCase {
9494
func testSetTrackingDisabled() throws {
9595
print("[Test] Starting testSetTrackingDisabled")
9696

97-
let sdk = BranchSDKTest()
97+
let expectation = expectation(description: "My asynchronous operation should complete")
98+
99+
let sdk = BranchSDKTest(){ params, error in
100+
print(params as? [String: AnyObject] ?? {})
101+
expectation.fulfill()
102+
}
98103

99104
print("[Test] Disabling tracking...")
100105
sdk.disableTracking(status: true)
@@ -107,19 +112,10 @@ final class iOSReleaseTestTests: XCTestCase {
107112
print("[Test] Disabling tracking again...")
108113
sdk.disableTracking(status: true)
109114

110-
print("[Test] testSetTrackingDisabled completed successfully")
111-
}
115+
waitForExpectations(timeout: 5, handler: nil) // Wait for up to 5 seconds
112116

113-
func testPerformanceExample() throws {
114-
print("[Test] Starting performance test *********************")
115-
measure {
116-
print("[Performance] Measuring performance...********************")
117-
let sdk = BranchSDKTest()
118-
sdk.disableTracking(status: false)
119-
_ = sdk.trackingStatus()
120-
}
121117

122-
print("[Test] Performance test completed")
118+
print("[Test] testSetTrackingDisabled completed")
123119
}
124120

125121
}

SDKIntegrationTestApps/iOSReleaseTest-SPM/iOSReleaseTest/BranchSDKTest.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ import BranchSDK
1010

1111
class BranchSDKTest {
1212

13-
init() {
14-
Branch.getInstance().enableLogging()
15-
Branch.getInstance().initSession(launchOptions: nil) { (params, error) in
16-
print(params as? [String: AnyObject] ?? {})
17-
}
13+
init(callback: @escaping ([AnyHashable: Any]?, Error?) -> Void) {
14+
// Branch.getInstance().enableLogging()
15+
// Branch.getInstance().initSession(launchOptions: nil, callback: callback)
16+
Branch.getInstance().initSession(launchOptions:nil, andRegisterDeepLinkHandler: callback)
1817
}
1918

2019
func disableTracking( status: Bool) {

0 commit comments

Comments
 (0)