A facebook link not opening on iphone
I want to open a facebook comment page link Like
http://www.facebook.com/comments.php?href=http://wombeta.jiffysoftware.com/ViewWOMPrint.aspx?WPID=310
but problem is this link doesnot open in iphone device or simulator but opens fine on desktop.When i try to open this link on simulator it opens the m.facebook site then shows error "Could not find the page" Please tell me a way to open this link in iphone
My code is simple:
NSURL *url = [NSURL URLWithString:@"http://www.facebook.com/comments.php?href=http://wombeta.jiffysoftware.com/ViewWOMPrint.aspx?WPID=317"];
NSURLRequest *requestObject = [NSURLRequest r开发者_高级运维equestWithURL:url];
[webView loadRequest:requestObject];
response of any url from FB server (like many other servers) is based on the "user agent" whenever a web call is made, the device automatically attach user agent with request. In your case the "user agent" is being sent by devices is the one of mobile Safari - Native iphone Safari app so the server is returning with mobile site response with m.facebook......
you need to find a mobile site equivalent link for the same and I'm pretty sure that FB will have it in some way or the other.
Best of Luck!
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com/comments.php?href=http://wombeta.jiffysoftware.com/ViewWOMPrint.aspx?WPID=317"]];
it will open safari browser and redirect to required URL.
精彩评论