File tree Expand file tree Collapse file tree 2 files changed +12
-17
lines changed
iOSReleaseTest-SPM/iOSReleaseTest Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ import BranchSDK
1010
1111class 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 ) {
You can’t perform that action at this time.
0 commit comments