gpt4 book ai didi

ios - webview后如何返回应用程序?

转载 作者:行者123 更新时间:2023-11-30 11:54:43 24 4
gpt4 key购买 nike

应用程序流程要求用户访问网页并更新一些详细信息,然后用户需要返回网站提供的 ID。

工作场景:

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

所需的Senario:

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

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

最佳答案

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

关于ios - webview后如何返回应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47944740/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com