Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-28-2008, 11:34 PM   #1 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
Default iPhone UIWebView user agent

Hi, I was just wondering if one can change the default user agent for UIWebView. The default is "WebApps/1.0 CFNetwork/339.3 Darwin/9.4.1"

I want it to be actual iPhone user agent, which is: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0

Any idea how to do that? thanks
aahmed753 is offline   Reply With Quote
Old 02-14-2009, 08:40 PM   #2 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 4
Default

Have you got this working? I want to do the similar thing.
kusolito is offline   Reply With Quote
Old 02-14-2009, 10:45 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 429
Default

You could fetch the data manually through a HTTP POST or GET request and then feed the result into the UIWebView.
lbendlin is offline   Reply With Quote
Old 02-15-2009, 12:30 AM   #4 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 4
Default

Actually I wanted to overrride the user-agent string in the request header. I tried to do that using NSMutableURLRequest in the UIWebViewDelegate function, but didn't work. I am a newbie to Objective-C and iphone app so maybe I missed something. Please help!
kusolito is offline   Reply With Quote
Old 02-15-2009, 08:38 AM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 429
Default

I was giving you the alternative, as what you are trying to do is not possible with UIWebView directly
lbendlin is offline   Reply With Quote
Old 02-06-2012, 02:15 AM   #6 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 1
Default Found it

Involves setting a user default:

Easily set the User-Agent in a UIWebView | MPHWeb

Hope this helps others out there.
lopezpa is offline   Reply With Quote
Reply

Bookmarks

Tags
uiwebview, web

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 232
15 members and 217 guests
ADY, Alsahir, cacao, dacapo, Dani77, Desert Diva, djohnson, HemiMG, jansan, M@realobjects, MarkC, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0