Sportica   Sportica

iOS 设置 UIWebView UserAgent

 NSString *userAgent = [[[UIWebView alloc] init] stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];

    NSString *customUserAgent = [userAgent stringByAppendingFormat:@"%@", @"; xfq/1.0"];

    [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent":customUserAgent}];

posted @ 2015-08-02 16:25  qingjoin  阅读(456)  评论(0编辑  收藏  举报
  Sportica