fcl-swift
fcl-swift copied to clipboard
Crash while getting the blocto address
What I am facing is my application starts crashing and restarting the phone on this method try await fcl.authanticate(accountProofData: accountProofData) and in the debugger console it showed a Message from the debugger: Terminated due to signal 9. Please help me because it's random crash and once it occurs then application keeps crashing.
@IBAction func actionBloctoLogin(_ sender: Any) {
// loginAPI(bloctoAddress: "address.hexStringWithPrefix")
let nonce = "75f8587e5bd5f9dcc9909d0dae1f0ac5814458b2ae129620502cb936fde7120a"
let accountProofData = FCLAccountProofData(
appId: bloctoSDKAppId,
nonce: nonce
)
Task {
do {
let address = try await fcl.authanticate(accountProofData: accountProofData)
loginAPI(bloctoAddress: address.hexStringWithPrefix)
} catch {
//self.handleRequestAccountError(error)
}
}
}
Please make sure you run task in @MainActor
I have used the @MainActor but seems it still starts behaving the same again. here is my code. if you can send me the code example for that, it will help a lot
let nonce = "75f8587e5bd5f9dcc9909d0dae1f0ac5814458b2ae129620502cb936fde7120a"
let accountProofData = FCLAccountProofData(
appId: bloctoSDKAppId,
nonce: nonce
)
Task { @MainActor in
do {
let address = try await fcl.authanticate(accountProofData: accountProofData)
loginAPI(bloctoAddress: address.hexStringWithPrefix)
} catch {
//self.handleRequestAccountError(error)
}
}
Sorry to get back to you so late. Did you solve this issue already? If not, can you provide the log or stack trace?