vimeo - 在 iOS/Swift 中使用 VimeoNetworking 设置客户端时出错
问题描述
我已经通过 Cocoapods 在我的项目中安装了 VimeoNetworking,并且我正在使用 XCode 12.5。尝试设置客户端,以便我可以浏览 Vimeo 中的可用视频。我已经按照每个步骤从这里和这里开始,并且我正在为我的帐户使用正确的客户端标识符和客户端密码。使用下面的代码,对于 vimeoClient 声明,我收到错误“调用中的参数 'configureSessionManagerBlock' 的参数缺失”,对于 authenticationController 声明,出现“调用中的参数 'appConfiguration','configureSessionManagerBlock' 的参数缺失”。我完全从两个 Vimeo 开发人员站点复制了示例代码。知道为什么 Vimeo 文档和示例代码不起作用吗?
import UIKit
import VimeoNetworking
class PhotoAlbumVC: UIViewController {
// overridden ---------------------
override func viewDidLoad() {
super.viewDidLoad()
let appConfiguration = AppConfiguration(
clientIdentifier: "foobar",
clientSecret: "blahblahblah",
scopes: [.Public, .Private, .Interact], keychainService: "vimeo")
let vimeoClient = VimeoClient(appConfiguration: appConfiguration)
let authenticationController = AuthenticationController(client: vimeoClient)
authenticationController.clientCredentialsGrant { result in
switch result {
case .Success(let account):
print("Successfully authenticated with account: \(account)")
case .Failure(let error):
print("error authenticating: \(error)")
}
}
}
}
解决方案
推荐阅读
- c# - 使用 nSwag 生成 TypeScript 代理:对可为空的 int 进行空检查
- python - 过滤数据框中的列以仅获取包含特定单词的列条目
- excel - VBA 无法从 Sharepoint 获取内容类型属性
- javascript - 如何在 jQuery 中选择多个库类型?
- charts - vAxis 在图表中不可见
- google-cloud-platform - 我在 gcp dicom 商店中导入图像,但在我的 pubsub 主题上分配的 dicom 商店没有发布消息
- python - 如何将参数传递给本身作为 kwarg 传递的函数
- java - 使用 gradle 在本地导入后未找到 Vertica JDBC 类
- laravel - 默认情况下,更新的依赖下拉列表会在 Laravel 中加载所有状态
- react-native - stickyHeaderIndices 在倒置的 FlatList 中无法正常工作