chore: v0.3.6
This is the open-source SDK for Aliyunpan OpenAPI.
示例 · 反馈 Bug · 提交需求
在开始前,请查看阿里云盘开放平台接入指南:
👉 如何注册三方开发者
let client: AliyunpanClient = AliyunpanClient( .init( appId: "YOUR_APP_ID", scope: "YOUR_SCOPE", // e.g. user:base,file:all:read ) )
你可以使用 SDK 提供的多种授权方式授权
client.authorize(credentials: credentials)
使用 SDK,你可以轻松使用所有已提供的 OpenAPI 和它们的请求体、返回体模型
// Concurrency try await client.send( AliyunpanScope.User.GetUsersInfo()) // -> GetUsersInfo.Response try await client.send( AliyunpanScope.File.GetFileList( .init(drive_id: driveId, parent_file_id: "root")))) // -> GetFileList.Response // Closure client.send( AliyunpanScope.User.GetUsersInfo()) { result in /// do something }
let uploader = client.uploader // 上传 let task = Task { let file = try? await uploader.upload( fileURL: url, fileName: fileName, driveId: driveId, folderId: folderId, useProof: true // 是否开启快传 ) } // 取消 task.cancel()
let downloader = client.downloader // 下载 let task = downloader.download(file: file, to: destination) // let task = downloader.tasks.first // 修改并发数,默认为10 downloader.maxConcurrentOperationCount = 10 // 暂停 downloader.pause(task) // 恢复 downloader.resume(task) // 取消 downloader.cancel(task) // AliyunpanDownloadDelegate // 下载速度变化 // func downloader(_ downloader: AliyunpanDownloader, didUpdatedNetworkSpeed networkSpeed: Int64) // 下载任务状态变化 // func downloader(_ downloader: AliyunpanDownloader, didUpdateTaskState state: AliyunpanDownloadTask.State, for task: AliyunpanDownloadTask) downloadr.addDelegate(DELEGATE)
FileListViewController
https://github.com/alibaba/aliyunpan-ios-sdk.git
target 'MyApp' do pod 'AliyunpanSDK', '~> 0.2' end
👉 文档
This project is licensed under the MIT License.
AliyunpanSDK
This is the open-source SDK for Aliyunpan OpenAPI.
示例 · 反馈 Bug · 提交需求
准备工作
在开始前,请查看阿里云盘开放平台接入指南:
👉 如何注册三方开发者
快速开始
1. 创建 Client
2. 授权
你可以使用 SDK 提供的多种授权方式授权
Credentials
3. 发送命令
使用 SDK,你可以轻松使用所有已提供的 OpenAPI 和它们的请求体、返回体模型
高级功能
上传
下载
示例
FileListViewController
安装方式
Swift Package Manager
https://github.com/alibaba/aliyunpan-ios-sdk.gitCocoaPods
要求
文档
👉 文档
TODO
License
This project is licensed under the MIT License.