Facebook 链接无法在 iPhone 上打开
我想打开一个 Facebook 评论页面链接,例如
但是问题此链接无法在 iPhone 设备或模拟器中打开,但在桌面上可以正常打开。当我尝试在模拟器上打开此链接时,它会打开 m.facebook 网站,然后显示错误“无法找到该页面”请告诉我打开此链接的方法iPhone 中的链接
我的代码很简单:
NSURL *url = [NSURL URLWithString:@"http://www.facebook.com/comments.php?href=http://wombeta.jiffysoftware.com/ViewWOMPrint.aspx?WPID=317"];
NSURLRequest *requestObject = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObject];
I want to open a facebook comment page link Like
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 requestWithURL:url];
[webView loadRequest:requestObject];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 FB 服务器(与许多其他服务器一样)的任何 url 响应都基于“用户代理”,每当进行 Web 调用时,设备都会自动将用户代理附加到请求。在您的情况下,设备发送的“用户代理”是移动 Safari - 本机 iphone Safari 应用程序之一,因此服务器返回 m.facebook 的移动站点响应......
您需要找到一个移动站点相同的等效链接,我很确定 FB 会以某种方式拥有它。
祝你好运!
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!
它将打开 safari 浏览器并重定向到所需的 URL。
it will open safari browser and redirect to required URL.