问题描述
我在深圳图书馆进行测试,这里有名为“reader”无密码无线网 可以正常连接,但不能直接上网的。
每次打开网页时 如果没有进行“登录”操作 则会定位到一个2.2.2.2/login.html页 具体如下:
比如我在地址栏中输入: http://livepage.apple.com 第一次则这样定位 https://2.2.2.2/login.html?redirect=livepage.apple.com/
同时浏览器弹出一个身份验证的对话框 大致意思是问你”不能验证2.2.2.2的身份,是否继续“ 对话框上有“显示证书” “取消” “继续”按钮
点继续后加载“https://2.2.2.2/fs/customwebauth/login.html?switch_url=https://2.2.2.2/login.html&ap_mac=00:1f:ca:cc:97:10&wlan=reader&redirect=livepage.apple.com/” 这个地址,网页是一个“登录”页 输入“证号”与“密码” 验证成功后 就可以正常
上网了
我现在火狐、ie safari 都能正确弹出那个问是否继续的证书显示框,但我用UIWebView 上网时 网页一直在加载中 UIWebView 要怎么配置或操作才能跟正常的浏览器一样程现那个“登录”验证过程呀?
我在深圳图书馆进行测试,这里有名为“reader”无密码无线网 可以正常连接,但不能直接上网的。
每次打开网页时 如果没有进行“登录”操作 则会定位到一个2.2.2.2/login.html页 具体如下:
比如我在地址栏中输入: http://livepage.apple.com 第一次则这样定位 https://2.2.2.2/login.html?redirect=livepage.apple.com/
同时浏览器弹出一个身份验证的对话框 大致意思是问你”不能验证2.2.2.2的身份,是否继续“ 对话框上有“显示证书” “取消” “继续”按钮
点继续后加载“https://2.2.2.2/fs/customwebauth/login.html?switch_url=https://2.2.2.2/login.html&ap_mac=00:1f:ca:cc:97:10&wlan=reader&redirect=livepage.apple.com/” 这个地址,网页是一个“登录”页 输入“证号”与“密码” 验证成功后 就可以正常
上网了
我现在火狐、ie safari 都能正确弹出那个问是否继续的证书显示框,但我用UIWebView 上网时 网页一直在加载中 UIWebView 要怎么配置或操作才能跟正常的浏览器一样程现那个“登录”验证过程呀?
解决方案 »
- 为什么运行时老是提示我在定义的uiview对象名面前加下划线_?
- Xcode4.6 storyboard视图中找不见identifier了?····
- 黑苹果可以将Xcode项目文件下载到iPhone上运行么
- 关于iphone开发
- ASIHttprequest 在自定义类中不执行回调函数
- tableViewCell的问题
- 分享一套,Swift编程入门到精通的视频教程(还有笔记和源码)
- iOS NSDictionary深度遍历,包含数组怎么办?
- 跟大家求个3D模型展示的iOS端 demo,抱拳
- 高手看过来!求解,坐等回复啊!看了好几天,没有头绪。
- 把自己开发的程式的弄到windows mobile的桌面
- object-c中@是什么意思,有什么作用
- (void)webView:(UIWebView *)webView
resource:(NSObject *)resource
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
fromDataSource:(WebDataSource *)dataSource;
- (void)webView:(id)webView resource:(id)resource didReceiveAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource {
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"user" password:@"password" persistence:NSURLCredentialPersistenceForSession];
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
}
NSString *authString = [[[NSString stringWithFormat:@"%@:%@", email, password] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];authString = [NSString stringWithFormat: @"Basic %@", authString];[requestObj setValue:authString forHTTPHeaderField:@"Authorization"];
}
NSURL *url = [NSURL URLWithString:urlAddress];
NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];[Utility addAuthToWebRequest:requestObj email:[Account getCurrentAccount].email password:[Account getCurrentAccount].password];
#import <UIKit/UIView.h>
#import <UIKit/UIKitDefines.h>
#import <UIKit/UIDataDetectors.h>enum {
UIWebViewNavigationTypeLinkClicked,
UIWebViewNavigationTypeFormSubmitted,
UIWebViewNavigationTypeBackForward,
UIWebViewNavigationTypeReload,
UIWebViewNavigationTypeFormResubmitted,
UIWebViewNavigationTypeOther
};
typedef NSUInteger UIWebViewNavigationType;@class UIWebViewInternal;
@protocol UIWebViewDelegate;UIKIT_EXTERN_CLASS @interface UIWebView : UIView <NSCoding> {
@private
UIWebViewInternal *_internal;
}@property(nonatomic,assign) id<UIWebViewDelegate> delegate;- (void)loadRequest:(NSURLRequest *)request;
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL;
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL;@property(nonatomic,readonly,retain) NSURLRequest *request;- (void)reload;
- (void)stopLoading;- (void)goBack;
- (void)goForward;@property(nonatomic,readonly,getter=canGoBack) BOOL canGoBack;
@property(nonatomic,readonly,getter=canGoForward) BOOL canGoForward;
@property(nonatomic,readonly,getter=isLoading) BOOL loading;- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script;@property(nonatomic) BOOL scalesPageToFit;@property(nonatomic) BOOL detectsPhoneNumbers __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_3_0);
@property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0);@end@protocol UIWebViewDelegate <NSObject>@optional
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
- (void)webViewDidStartLoad:(UIWebView *)webView;
- (void)webViewDidFinishLoad:(UIWebView *)webView;
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error;@end
这个是我在3.1.2sdk中找到的api