You can connect, reconnect & disconnect with meta mask using walletconnect swift lib. Here is the link of it: https://github.com/WalletConnect/WalletConnectSwift
There have two section:
- Server
- Client
Server is used for wallet side functionalities. i.e. metamask, trustwallet and so on
Client is used to implement dApps where User initiate connect request and metamask/trustwallet app gets and request and approve it.
You should take a look at clientside code, which helpful to implement dapps.
Verfication is depends on the bridgeURL you used in the demo. Here is the bridge link, you should use: https://safe-walletconnect.gnosis.io/
Here is the code which help to have verification on metamask:
func connect() -> String {
let wcUrl = WCURL(topic: UUID().uuidString,
bridgeURL: URL(string: "https://safe-walletconnect.gnosis.io/")!,
key: try! randomKey())
let clientMeta = Session.ClientMeta(name: "ExampleDemoApp",
description: "WalletConnectDemo",
icons: [],
url: URL(string: "https://safe.gnosis.io")!)
let dAppInfo = Session.DAppInfo(peerId: UUID().uuidString,
peerMeta: clientMeta,
chainId: ViewController.chainID)
client = Client(delegate: self, dAppInfo: dAppInfo)
print("WalletConnect URL: \(wcUrl.absoluteString)")
try! client.connect(to: wcUrl)
return wcUrl.absoluteString
}
Hope it will help you. Its working on my side.