Can WKWebView work from hotspot url?

Version: XCode 6.1 beta p>

Backend: Sharepoint 2013

Sample code for doubt is below

Call to View DidLoad

    WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
WKWebView *webView = [[WKWebView alloc] initWithFrame:self.eyWebView.frame configuration:theConfiguration];
    webView.navigationDelegate = self;
    NSString *eUrl = [[EYUtility share] encodingUrlWithString:<-sharepoint url->;
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:eUrl]];
    [self.view addSubview:webView];
    [webView loadRequest:request];

      

After viewing DidLoad to call didReceiveAuthenticationChallenge method

-(void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler{
    if (challenge.previousFailureCount == 0){
        NSURLCredentialPersistence persistence = NSURLCredentialPersistenceForSession;
        NSURLCredential *credential = [NSURLCredential credentialWithUser:@"username" password:@"password" persistence:persistence];
        completionHandler(NSURLSessionAuthChallengeUseCredential,credential);
    }
    else{
        NSLog(@"%s: challenge.error = %@", __FUNCTION__, challenge.error);
        completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
    }
} 

      

After the call to "Authentication" after the call, "didFinishNavigation" is called. WkWebview shows "Please wait ...". Not specified from the access point URL.

Why not show it from the hotspot url.

+3


source to share


1 answer


Here I am using UIWebview with CustomHTTPProtocol class. it will work with sharepoint url.

https://developer.apple.com/library/ios/samplecode/CustomHTTPProtocol/Introduction/Intro.html



Cheer :-)

0


source







All Articles