본문 바로가기

UIWebview6

UIWebView에서 user Agent 변경 [IOS] iOS 5 이상 AppDelegate.m 파일에 아래 코드를 넣으면 됩니다. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *deviceModel = [[UIDevice currentDevice].model stringByReplacingOccurrencesOfString:@"" withString:@""]; NSString *userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Geck.. 2015. 12. 17.
UIWeview 링크 새창 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { // open External Links (not beginning with www.playbuzz.org/ in Safari.app if ( (navigationType == UIWebViewNavigationTypeLinkClicked) && ( ![[[request URL] absoluteString] hasPrefix:@"http://www.naver.com/"]) ) { [[UIApplication sharedApplication] open.. 2015. 12. 15.
user agent [IOS] IOS User Agent 세팅 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { NSDictionary*dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@"your agent", @"UserAgent", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary]; [[NSUserDefaults standardUserDefaults] synchronize]; retur.. 2015. 12. 15.
UIWebView user-agent [IOS] 기존에 user-agent 변경하는 방법을 Swizzle을 이용해서 변경했었는데 iOS 5로 업데이트 되면서 변경이 안되었다. 물론 앱스토어에 올라가 있는 앱들이 제대로 되지도 않고.. 그래서 찾아보다가 한참을 헤매었는데 위 블로그에서 아래와 같은 방법을 찾았다. AppDelegate.m 파일에 아래 코드를 넣으면 됩니다. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *deviceModel = [[UIDevice currentDevice].model stringByReplacingOccurrencesOfString:@"" withStri.. 2015. 12. 15.