alpha-wallet-ios icon indicating copy to clipboard operation
alpha-wallet-ios copied to clipboard

Attestastion-Connect. OTP form opens again after signing Alpha wallet in Attestation on mobile

Open oa-s opened this issue 2 years ago • 4 comments

Link https://smarttokenlabs.atlassian.net/browse/TKS-602

oa-s avatar May 16 '23 13:05 oa-s

@hboon it looks like we need to add pases handling here, replaced existing code

func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
        if navigationAction.targetFrame == nil {
            browserViewController.webView.load(navigationAction.request)
        }
        return nil
    }

with such code, popups displaying in same way as in Safary

func webView(_ webView: WKWebView,
                 createWebViewWith configuration: WKWebViewConfiguration,
                 for navigationAction: WKNavigationAction,
                 windowFeatures: WKWindowFeatures) -> WKWebView? {

//        if navigationAction.targetFrame == nil {
//            browserViewController.webView.load(navigationAction.request)
//            return nil
//        } else {
            let view = browserViewController.view!

            let popupWebView = WKWebView(frame: view.bounds, configuration: configuration)

            popupWebView.navigationDelegate = self
            popupWebView.uiDelegate = self
            popupWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = true
            popupWebView.configuration.preferences.javaScriptEnabled = true

            view.addSubview(popupWebView)

            NSLayoutConstraint.activate([
                popupWebView.widthAnchor.constraint(equalTo: view.widthAnchor),
                popupWebView.heightAnchor.constraint(equalTo: view.heightAnchor),

                popupWebView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
                popupWebView.centerYAnchor.constraint(equalTo: view.centerYAnchor)
            ])

            self.popupWebView = popupWebView

            return popupWebView
//        }
    }

to handle all created web views we would need to make pages, with opening a new page for browser.

any ideas?

oa-s avatar May 16 '23 13:05 oa-s

Hmm. That means having to handle open windows, and all the window management support, right? Let’s see if it’s possible that they run without pop ups? I think there’s a redirect mode.

hboon avatar May 16 '23 14:05 hboon

haven't find any tips to solve this, tabs handling could bring additional work and bugs

oa-s avatar May 17 '23 06:05 oa-s

We don’t have to fix it by adding pop up support. Just let them know we don’t. But is the reloading an issue? Why is it doing that?

hboon avatar May 17 '23 07:05 hboon