Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sivaprakash

macrumors member
Original poster
Mar 10, 2011
52
0
Chennai, India
Hi

I am trying to load an URL in WebView and I am getting an error "Browser not Supported. Please try a more recent version, or a different browser."

URL that I am trying to load (model)

https://xxxxx.xxxxxxxxxxxx.com/Vend...x=3456&xxxx=4322&username=yyyy&password=*****


Code that I am using to load is

NSString *urlText ;

urlText = @"https://xxxxx.xxxxxxxxxxxx.com/Vendor?xxxxx=none&xxxxxxx=none&xxx=3456&xxxx=4322&username=yyyy&password=*****";

[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];


Can someone help me what is wrong in my code ? Or do I need to Upgrade. I may machine Safari is the default browser. But if use the browser to load this URL works fine I am facing issue only with the WebView at the same time other sites like www.google.com and others are working well.

Thanks
Siva
 
This doesn't sound like an error from WebView itself, but an "error" page that's being served from the web application you're trying to access. Try spoofing the user agent.

BTW WebView always uses Safari's WebKit engine regardless of your default browser. That is if you make Firefox your default browser, your program wouldn't start embedding Firefox into your window.
 
Debug Time!

Can you access that URL from Safari?
Can you access that URL from Firefox?
Can you access that URL from IE 6?
Can you access other URLs using your code?
 
hmmm . . .

@ Patrick - Answer for all your questions is YES. But it doesnt work in WebView only.

As previously suggested, maybe there's some character in the URL that WebView doesn't like. The most unusual URL I ever load is:
@"http://www.highschoolsports.net/defaultcal.cfm?ct=s&schoolid=KS6621212106&spt=4&lvl=-1&divison=-1&timeoffset=300"

which works fine.

Maybe try simpler versions of your URL, starting with something basic and working up, adding complexity until it breaks. Start with:
@"https://xxxxx.xxxxxxxxxxxx.com/"

and see if that works.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.