swift - 带有 Dexcom API 的 OAuthSwift:获取输出帧失败,状态 8196
问题描述
我在使用带有 Dexcom API ( https://developer.dexcom.com/authentication ) 的 OAuthSwift 获取令牌然后发出请求时遇到问题。
这是我当前用于通过单击链接到登录和重定向的按钮来授权用户使用服务的代码。
import UIKit
import OAuthSwift
class ViewController: UIViewController {
// UI Elements
@IBOutlet weak var resultLabel: UILabel!
@IBAction func authorizeTapped(_ sender: Any) {
authorizeDexcom()
}
var oauthswift: OAuth2Swift = OAuth2Swift(
consumerKey: "***",
consumerSecret: "***",
authorizeUrl: "https://sandbox-api.dexcom.com/v2/oauth2/login?",
accessTokenUrl: "https://sandbox-api.dexcom.com/v2/oauth2/token",
responseType: "code"
)
// Dexcom Test Functions
func authorizeDexcom() {
oauthswift.allowMissingStateCheck = true
oauthswift.authorizeURLHandler = SafariURLHandler(viewController: self, oauthSwift: oauthswift)
guard let rdURI = URL(string: "***") else {
return
}
oauthswift.authorize(withCallbackURL: rdURI,
scope: "offline_access",
state: "",
success: { credential, response, parameters in
print("SUCCESS")
print(credential.oauthToken)
}, failure: { error in
print(error.localizedDescription)
}
)
}
有人可以指导我下一步应该做什么或我应该如何在这里提出请求吗?当我运行我的应用程序并单击调用授权函数的按钮时,我得到了似乎是在控制台中打印的令牌,但后面跟着几行“获取输出帧失败,状态 8196”,这导致我相信授权过程没有正确完成。
我查看了以下资源,但还没有发现任何有用的东西。
谢谢你的帮助。
解决方案
iOS 12+ 具有健谈的网络日志记录。您的网络呼叫没有失败。
[BoringSSL] nw_protocol_boringssl_get_output_frames(1301) ... 获取输出帧失败,状态 8196
每次清理 URLSession 或显式调用 finishTasksAndInvalidate() 时都会输出此信息。
据我所知,如果不抑制所有操作系统日志记录,就无法抑制它,这是一个坏主意。如果有人知道如何专门禁止此消息,请回复。
推荐阅读
- workflow - 带有通配符的 Snakemake 古代标记
- google-data-studio - 日期下拉列表未在数据洞察中立即更新
- angular - Angular - 未通过更改检测注册的对象的值更改
- javascript - 多阵列过滤条件
- typescript - 如何将 typescript 添加到 Vue 3 和 Vite 项目
- iis - 无法打开网站“http://localhost/XYZ”。无法读取与解决方案关联的某些属性
- javascript - Microsoft.Azure.WebJobs.Script:无法将“System.String”类型的对象转换为“Microsoft.AspNetCore.Http.HttpRequest”类型。返回时
- eloquent - 如何从基于不同表的 id 关系 laravel 中获取总和值然后显示在视图中?
- package - Python 包安装
- google-chrome - Chrome:控制台日志消息在哪里?