HomeiOS Developmentios - Belief pockets not join with walletconnect for model 2

ios – Belief pockets not join with walletconnect for model 2


I’ve an utility which join the metamask pockets app with the pockets join SDk v1.
From the it is verifying the connection and permits person to login in app.
Now i wish to replace the pockets join SDK with model 2. This model 2 isn’t obtainable in metamask for now so I attempted to attach the pockets join with belief pockets.

https://github.com/WalletConnect/WalletConnectSwift

I’ve referred it is doc for implementation https://docs.walletconnect.com/2.0/ but it surely’s not working.

I’ve created uri (deep hyperlink) from the code and i used to be ready redirect to the belief pockets but it surely not exhibiting the verifying display screen. It at all times exhibits the pockets join session was disconnected.

Trust wallet shows this error

I’ve tried under code pattern and likewise checked with pattern Dapp from the SDK

`let namespaces: [String: ProposalNamespace] = [
            "eip155": ProposalNamespace(
                chains: [
                    Blockchain("eip155:137")!,
                    Blockchain("eip155:1")!
                ],
                strategies: ["personal_sign"], occasions: ["accountsChanged", "chainChanged"]
            )
        ]

Process {
            let uri = strive await Pair.occasion.create()
            strive await Signal.occasion.join(
                requiredNamespaces: namespaces
                matter: uri.matter
            )
            await showConnectScreen(uri: uri)
        }

func showConnectScreen(uri: WalletConnectURI) async {
let url = URL(string: "https://hyperlink.trustwallet.com/wc?uri=(uri.absoluteString)")!
//or test with pockets join as properly
//            let url = URL(string: "https://walletconnect.com/wc?uri=(uri.absoluteString)")!
            DispatchQueue.foremost.async {
                UIApplication.shared.open(url, choices: [:]) { [weak self] _ in
                    self?.dismiss(animated: true, completion: nil)
                }
            }
}`

I would like belief pockets app to confirm my app for connection, ship and obtain the info from it.
`

Signal.occasion.sessionDeletePublisher
            .obtain(on: DispatchQueue.foremost)
            .sink {  _ in
                print("showSelectChainScreen")
            }.retailer(in: &publishers)

        Signal.occasion.sessionResponsePublisher
            .obtain(on: DispatchQueue.foremost)
            .sink {  response in
            }.retailer(in: &publishers)

        Signal.occasion.sessionSettlePublisher
            .obtain(on: DispatchQueue.foremost)
            .sink { [unowned self] session in
                print("session: (session)")
            }.retailer(in: &publishers)`

I’ve test the pockets connection on https://pancakeswap.finance. which works from browser.
It exhibits a number of pockets to attach with and confirm the connection additionally

It will be nice if I join with every other pockets app additionally.I would like is ought to work with from cellular utility not from desktop utility.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments