【问题标题】:How to return back to the application after webview?webview后如何返回应用程序?
【发布时间】:2018-06-05 07:09:42
【问题描述】:

应用流程要求用户访问一个网页并更新一些细节,之后用户需要返回该网站提供的 id。

工作场景:

User logs in application 
  clicks button goes to the website update few details 
  stays in the Webview for the website

所需的条件:

Should come back to the app with the id that website provided 

应用程序的流程类似于 google Oauth,其中用户单击 google 按钮以验证 google 以使用 google 帐户。

【问题讨论】:

  • 您已使用 UIWebView 标记此内容,但您还说“回到应用程序”。如果您使用的是UIWebView,您还没有离开该应用程序。你能澄清一下实际的结构吗?
  • 为混乱道歉,我的意思是回来返回到以前的 UIController,因为 web 视图填满了屏幕,用户无法返回到以前的视图

标签: ios swift uiwebview stripe-connect


【解决方案1】:

您可以在 WKWebView 中显示网页。假设您也在编写网页代码,您还可以使用evaluateJavaScript(:completionHandler:) 来确定网站何时完成,获取结果,然后关闭 WKWebView。或者,您可以使用 WKNAvigationDelegate 方法webView(:didStartProvisionalNavigation:) 拦截成功导航,然后从服务器获取您需要的任何信息。

【讨论】:

  • 网页是第三方应用,所以无法执行上述操作
  • 然后拦截导航。
猜你喜欢
  • 2014-06-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-16
相关资源
最近更新 更多