Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dapp Browser #303

Closed
RajKumar7777 opened this issue Jan 11, 2021 · 7 comments
Closed

Dapp Browser #303

RajKumar7777 opened this issue Jan 11, 2021 · 7 comments
Labels
question Further information is requested

Comments

@RajKumar7777
Copy link

Hi, Am integrating a Dapp browser into my ETH wallet following your documentation.

I just downloaded your example project web3swiftBrowser and tried to work with.Only https://app.compound.finance this link is connecting and working.

I want to connect my wallet to https://uniswap.org.

Now what should I do..Please help me to continue....

Thanks.

@skywinder
Copy link
Collaborator

Hello.
describe your question in details please.

@skywinder skywinder added question Further information is requested wait for reply labels Jan 11, 2021
@CYC666
Copy link

CYC666 commented Jan 12, 2021

@RajKumar7777
Copy link
Author

@skywinder When I open "https://app.compound.finance", demo can auto connect wallet.
But when I open "https://app.uniswap.org/#/swap", demo cannot auto connect wallet.

Check with alpha wallet app when you open "https://app.uniswap.org/#/swap" it will auto connect wallet.

@CYC666
Copy link

CYC666 commented Jan 12, 2021

老哥,help me help me

@RajKumar7777
Copy link
Author

@skywinder Please help to solve this..

@skywinder
Copy link
Collaborator

dear, @RajKumar7777 , this is low level library. This question is not related to this functionality.
I will make a demo later. keep in touch.

@AlleniCode
Copy link

@skywinder I'm facing the same problem,when entered a dapp page with BrowserViewController, it cannot connect my wallet automatically.

https://github.com/skywinder/web3swift/blob/develop/Example/web3swiftBrowser/web3swiftBrowser/ViewController.swift

My code:

class DAppsViewController: BrowserViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        webView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(webView)

        NSLayoutConstraint.activate([
            webView.topAnchor.constraint(equalTo: view.topAnchor),
            webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            webView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            webView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
        ])

        var urlToOpen = "https://1inch.exchange/"
        urlToOpen = "https://app.compound.finance"
        urlToOpen = "https://app.uniswap.org"
        webView.load(URLRequest(url: URL(string: urlToOpen)!))

        do {
            let keystoreManager = KeystoreManager(["My EthereumKeystoreV3"])
            let web3 = Web3.InfuraMainnetWeb3()
            web3.addKeystoreManager(keystoreManager)
            
            self.registerBridges(for: web3)
        } catch {
            print(error)
        }
    }
}

QQ20210807-173440@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants