trustwallet / wallet-connect-swift

WalletConnect Swift client SDK
MIT License
115 stars 131 forks source link

when user disconnect using dapp, app side can not receive disconnect event #42

Open andybin-cdc opened 3 years ago

andybin-cdc commented 3 years ago

when user disconnect using dapp, app side can not receive disconnect event:

https://github.com/trustwallet/wallet-connect-swift/blob/master/WalletConnect/WCInteractor.swift#L205 in this line, I think it is necessary to add a callback to the App side.

can u help me to resolve this?

hewigovens commented 3 years ago

DisconnectClosure should work for you

andybin-cdc commented 3 years ago

Thank @hewigovens for your reply. I have already use the DisconnectClosure. But the callback was not called!

  1. when user disconnect using dapp. I found that the socket is still connected, it is just update the session approve state. https://github.com/trustwallet/wallet-connect-swift/blob/master/WalletConnect/WCInteractor.swift#L205

  2. in the disconnect function: https://github.com/trustwallet/wallet-connect-swift/blob/master/WalletConnect/WCInteractor.swift#L100 it is not call the DisconnectClosure

Is there something wrong with that?