I am trying to implement the TradeIt ios SDK and I am not able to compile due to issues in the sdk.
let promises = self.getAllDisplayableLinkedBrokers().map {
linkedBroker in
return Promise<Void> { seal in
linkedBroker.authenticateIfNeeded(
onSuccess: seal.fulfill,
onSecurityQuestion: onSecurityQuestion,
onFailure: { tradeItErrorResult in
onFailure(tradeItErrorResult, linkedBroker)
seal.fulfill(())
}
)
}
}
on the line with onSuccess: seal.fulfill,
there is an error: Cannot convert value of type '(Void) -> ()' to expected argument type '() -> Void'
The following is the definition for the authenticateIfNeeded
method that details what it's expecting for onSuccess.
@objc public func authenticateIfNeeded(onSuccess: @escaping () -> Void, onSecurityQuestion: @escaping (TradeItSecurityQuestionResult,_ submitAnswer: @escaping (String) -> Void, _ onCancelSecurityQuestion: @escaping () -> Void) -> Void,
onFailure: @escaping (TradeItErrorResult) -> Void
) -> Void {
guard let error = self.error else {
onSuccess()
return
}
if error.requiresAuthentication() {
self.authenticate(
onSuccess: onSuccess,
onSecurityQuestion: onSecurityQuestion,
onFailure: onFailure
)
} else if error.requiresRelink() {
onFailure(error)
} else {
onSuccess()
}
}
I am developing a react native application and I need to create a react native module for ios for the TradeIt sdk. That is why I am not familiar with objective-c and have a steep learning curve ahead of me. Any help would be appreciated. Thank you!