iOS 8 didReceiveAuthenticationChallenge not getting called for WKWebView Objective C -
i new ios development. have project have use wkwebview instead of uiwebview. simple webpage javascript objective-c , other way round integration. working fine except when try open server self-signed certificate. on safari shows dialog box can choose continue. on application cannot bypass this.
for reason have run self-signed certificate.
the delegate method didreceiveauthenticationchallenge never called. other delegate methods working fine. know didreceiveauthenticationchallenge depreciated in ios8 can please tell me workaround this. newbie complete working delegate method and/or other changes in code highly appreciated.
nsurl *url = [nsurl urlwithstring:@"https://mywebsite.com/default.aspx"]; nsurlrequest *request = [[nsurlrequest alloc] initwithurl:url]; [[self webview] loadrequest:request]; } // , delegate method not getting called - (void)webview:(wkwebview *)webview didreceiveauthenticationchallenge:(nsurlauthenticationchallenge *)challenge completionhandler:(void (^)(nsurlsessionauthchallengedisposition disposition, nsurlcredential *credential))completionhandler { sectrustref servertrust = challenge.protectionspace.servertrust; cfdataref exceptions = sectrustcopyexceptions(servertrust); sectrustsetexceptions(servertrust, exceptions); cfrelease(exceptions); completionhandler(nsurlsessionauthchallengeusecredential, [nsurlcredential credentialfortrust:servertrust]);
}
this has been confirmed bug apple. has been fixed in ios9.
Comments
Post a Comment