登录后不会重定向到UIWebView中的Facebook注释(Not redirecting to Facebook comments in UIWebView after login)

编程入门 行业动态 更新时间:2024-10-14 08:28:32
登录后不会重定向到UIWebView中的Facebook注释(Not redirecting to Facebook comments in UIWebView after login)

我使用Facebook提供的UIWebView和HTML5代码将Facebook评论添加到我的iPad应用程序中。 当用户未登录时,应用程序将显示评论和按钮“登录Facebook发布评论”。

点击按钮带我通过登录过程。 登录完成后,视图将以“完成登录”消息的空白页面重定向。 它不会被重定向回注释对话框。

现在我实施了一个丑陋的解决方法。 在收到webViewDidFinishLoad事件后,如果页面显示此消息,我将查看页面的内容并重新加载它。 尽管如此,它似乎并不是一个干净的方式。

为什么Facebook不会将我重定向回原始评论页面?

I am adding facebook comments to my iPad application using UIWebView and HTML5 code provided by Facebook. When the user is not logged in, the application shows the comments and button "Login to Facebook to Post a Comment".

Clicking the button takes me through login process. After the login completes the view is redirected with an empty page with "Login complete" message. It is not redirected back to the comments dialog.

Right now I implemented an ugly workaround. Upon receiving webViewDidFinishLoad event, I look at contents of the page and reload it if the page shows this message. Though, it does not seem a clean way to go.

Why doesn't Facebook redirect me back to original comments page?

最满意答案

我怀疑你遇到的问题与这个问题有关: UIWebView中的Facebook身份验证不会重定向到我的网站上的原始页面,要求进行身份验证

具体而言,标准的Facebook网页登录过程将启动一个新的浏览器窗口对话框,并向开叫者发送一条消息以指示重定向发生的登录成功。

在链接的SO中引用一段文字,“UIWebView不支持多个窗口,因此它不能将postMessage发回原始页面,因为它不再被加载。”

I suspect the problem you're having is related to this issue: Facebook authentication in a UIWebView does not redirect back to original page on my site asking for auth

Specifically, the standard Facebook web login process launches a new browser window dialog, and dispatches a message back to the opener to indicate login success for the redirect to occur.

Quoting a passage in the linked SO, "UIWebView doesn't support multiple windows so it can't postMessage back to your original page since it's no longer loaded."

更多推荐

本文发布于:2023-07-30 17:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1338873.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   重定向   UIWebView   login   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!