@@ -56,9 +56,9 @@ class ContextSDKBridge: NSObject {
56
56
}
57
57
58
58
@objc ( calibrate: maxDelay: customSignals: withResolver: withRejecter: )
59
- func calibrate( flowName: String , maxDelay: Int , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
59
+ func calibrate( flowName: String , maxDelay: NSNumber , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
60
60
let customSignalsID = createCustomSignals ( customSignals: customSignals)
61
- contextSDK_calibrate_rn ( flowName: flowName, customSignalsID: customSignalsID, maxDelay: Int32 ( maxDelay) ) { contextID in
61
+ contextSDK_calibrate_rn ( flowName: flowName, customSignalsID: customSignalsID, maxDelay: maxDelay. int32Value ) { contextID in
62
62
resolve ( contextID)
63
63
}
64
64
}
@@ -74,63 +74,63 @@ class ContextSDKBridge: NSObject {
74
74
}
75
75
76
76
@objc ( fetchContext: duration: customSignals: withResolver: withRejecter: )
77
- func fetchContext( flowName: String , duration: Int , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
77
+ func fetchContext( flowName: String , duration: NSNumber , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
78
78
let customSignalsID = createCustomSignals ( customSignals: customSignals)
79
- contextSDK_fetchContext_rn ( flowName: flowName, customSignalsID: customSignalsID, duration: Int32 ( duration) ) { contextID in
79
+ contextSDK_fetchContext_rn ( flowName: flowName, customSignalsID: customSignalsID, duration: duration. int32Value ) { contextID in
80
80
resolve ( contextID)
81
81
}
82
82
}
83
83
84
84
@objc ( instantContext: duration: customSignals: withResolver: withRejecter: )
85
- func instantContext( flowName: String , duration: Int , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
85
+ func instantContext( flowName: String , duration: NSNumber , customSignals: NSDictionary , resolve: @escaping RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) -> Void {
86
86
let customSignalsID = createCustomSignals ( customSignals: customSignals)
87
- let contextID = contextSDK_instantContext ( flowNameC: flowName, customSignalsID: customSignalsID, duration: Int32 ( duration) )
87
+ let contextID = contextSDK_instantContext ( flowNameC: flowName, customSignalsID: customSignalsID, duration: duration. int32Value )
88
88
contextSDK_releaseCustomSignals ( contextID: customSignalsID)
89
89
resolve ( contextID)
90
90
}
91
91
92
92
@objc ( releaseContext: withResolver: withRejecter: )
93
- func releaseContext( contextID: Int , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
94
- contextSDK_releaseContext ( contextID: Int32 ( contextID) )
93
+ func releaseContext( contextID: NSNumber , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
94
+ contextSDK_releaseContext ( contextID: contextID. int32Value )
95
95
resolve ( true )
96
96
}
97
97
98
98
@objc ( context_shouldUpsell: withResolver: withRejecter: )
99
- func context_shouldUpsell( contextID: Int , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
100
- let shouldUpsell = contextSDK_context_shouldUpsell ( contextID: Int32 ( contextID) )
99
+ func context_shouldUpsell( contextID: NSNumber , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
100
+ let shouldUpsell = contextSDK_context_shouldUpsell ( contextID: contextID. int32Value )
101
101
resolve ( shouldUpsell)
102
102
}
103
103
104
104
@objc ( context_validate: withResolver: withRejecter: )
105
- func context_validate( contextID: Int , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
106
- let output = String ( cString: contextSDK_context_validate ( contextID: Int32 ( contextID) ) )
105
+ func context_validate( contextID: NSNumber , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
106
+ let output = String ( cString: contextSDK_context_validate ( contextID: contextID. int32Value ) )
107
107
resolve ( output)
108
108
}
109
109
110
110
@objc ( context_log: outcome: withResolver: withRejecter: )
111
- func context_log( contextID: Int , outcome: Int , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
112
- contextSDK_context_log ( Int32 ( contextID) , Int32 ( outcome) )
111
+ func context_log( contextID: NSNumber , outcome: NSNumber , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
112
+ contextSDK_context_log ( contextID. int32Value , outcome. int32Value )
113
113
resolve ( true )
114
114
}
115
115
116
116
@objc ( context_logIfNotLoggedYet: outcome: withResolver: withRejecter: )
117
- func context_logIfNotLoggedYet( contextID: Int , outcome: Int , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
118
- contextSDK_context_logIfNotLoggedYet ( Int32 ( contextID) , Int32 ( outcome) )
117
+ func context_logIfNotLoggedYet( contextID: NSNumber , outcome: NSNumber , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
118
+ contextSDK_context_logIfNotLoggedYet ( contextID. int32Value , outcome. int32Value )
119
119
resolve ( true )
120
120
}
121
121
122
122
@objc ( context_appendOutcomeMetadata: values: withResolver: withRejecter: )
123
- func context_appendOutcomeMetadata( contextID: Int , values: NSDictionary , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
123
+ func context_appendOutcomeMetadata( contextID: NSNumber , values: NSDictionary , resolve: RCTPromiseResolveBlock , reject: RCTPromiseRejectBlock ) {
124
124
for (key, value) in values {
125
125
guard let stringKey = key as? String else { continue }
126
126
if let intValue = value as? Int {
127
- contextSDK_context_appendOutcomeMetadataInt ( contextID: Int32 ( contextID) , idC: stringKey, value: Int32 ( intValue) )
127
+ contextSDK_context_appendOutcomeMetadataInt ( contextID: contextID. int32Value , idC: stringKey, value: Int32 ( intValue) )
128
128
} else if let doubleValue = value as? Double {
129
- contextSDK_context_appendOutcomeMetadataFloat ( contextID: Int32 ( contextID) , idC: stringKey, value: Float ( doubleValue) )
129
+ contextSDK_context_appendOutcomeMetadataFloat ( contextID: contextID. int32Value , idC: stringKey, value: Float ( doubleValue) )
130
130
} else if let stringValue = value as? String {
131
- contextSDK_context_appendOutcomeMetadataString ( contextID: Int32 ( contextID) , idC: stringKey, valueC: stringValue)
131
+ contextSDK_context_appendOutcomeMetadataString ( contextID: contextID. int32Value , idC: stringKey, valueC: stringValue)
132
132
} else if let boolValue = value as? Bool { // TODO: Bools fall into the Int clause - we should fix this
133
- contextSDK_context_appendOutcomeMetadataBool ( contextID: Int32 ( contextID) , idC: stringKey, value: boolValue)
133
+ contextSDK_context_appendOutcomeMetadataBool ( contextID: contextID. int32Value , idC: stringKey, value: boolValue)
134
134
}
135
135
}
136
136
resolve ( true )
0 commit comments