【问题标题】:Display Auth Prompt in UIWebView在 UIWebView 中显示身份验证提示
【发布时间】:2016-10-06 10:01:40
【问题描述】:

我想访问 Sharepoint 站点,但是当 Office365 尝试将我重定向到我的身份验证组织页面时,UIWebView 被阻止。在桌面上,我看到一个带有 2 个文本字段的提示,但是,这里什么都没有!这是我的代码和屏幕截图:

class ViewController: UIViewController, NSURLConnectionDelegate {

@IBOutlet var webView: UIWebView!
@IBOutlet var refresh: UIBarButtonItem!

override func viewDidLoad() {
    super.viewDidLoad()

    if let theURL = URL(string: "https://expertime365.sharepoint.com/sites/retail-portal-v8/Pages/default.aspx") {
        let request = URLRequest(url: theURL)

        webView.loadRequest(request)
    }
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

}

这是截图:

【问题讨论】:

标签: ios swift xcode sharepoint office365


【解决方案1】:

是否检查了 webView 中加载的 url?

如果没有,请检查以下链接并与桌面浏览器中加载的网址进行比较。

您可以查看以下代码:

func webView(webview: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
    let currentURL = request.URL.absoluteString
    print("\(currentURL)")
  }

【讨论】:

    猜你喜欢
    • 2010-12-18
    • 1970-01-01
    • 1970-01-01
    • 2017-02-08
    • 2016-02-08
    • 2014-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多