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

iOS 웹뷰 팝업 처리 가이드 추가 #55

Open
kjh5833 opened this issue Apr 7, 2022 · 0 comments
Open

iOS 웹뷰 팝업 처리 가이드 추가 #55

kjh5833 opened this issue Apr 7, 2022 · 0 comments
Assignees

Comments

@kjh5833
Copy link
Contributor

kjh5833 commented Apr 7, 2022

이슈 : iOS 웹뷰에서 다날 본인인증 팝업모드(popup:true) 이용시 사파리의 팝업차단 여부와 관계 없이
웹뷰에서 팝업차단을 해제해주셔야 인증창이 나타납니다. alert 과 함께 redirect 모드로 동작함
팝업 모드 사용시 웹뷰에서 새탭을 열 수 있는 별도 처리를 해야 정상 동작이 가능함.

해결 : 가맹점 구현에 아래 내용 추가하고 본 가이드에 작성

var popupWebView: WKWebView?extension WebViewController: WKNavigationDelegate {func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
        let frame = UIScreen.main.bounds
        popupWebView = WKWebView(frame: frame, configuration: configuration)
        if let popup = popupWebView {
            popup.autoresizingMask = [.flexibleWidth, .flexibleHeight]
            popup.navigationDelegate = self
            popup.uiDelegate = self
            view.addSubview(popup)
            return popup
        }
        
        return nil
    }func webViewDidClose(_ webView: WKWebView) {
        if webView == popupWebView {
            popupWebView?.removeFromSuperview()
            popupWebView = nil
        }
    }
....
@kjh5833 kjh5833 self-assigned this Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant