fcl-swift icon indicating copy to clipboard operation
fcl-swift copied to clipboard

Crash while getting the blocto address

Open karam28 opened this issue 2 years ago • 3 comments

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)
       }
   }
    
    }

karam28 avatar Nov 19 '22 22:11 karam28

Please make sure you run task in @MainActor

andrew54068 avatar Nov 21 '22 04:11 andrew54068

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)
       }
   }

karam28 avatar Nov 29 '22 06:11 karam28

Sorry to get back to you so late. Did you solve this issue already? If not, can you provide the log or stack trace?

andrew54068 avatar Feb 22 '23 09:02 andrew54068