gpt4 book ai didi

swift - cloudinary swift 3 版本如何销毁图像

转载 作者:搜寻专家 更新时间:2023-11-01 07:05:31 25 4
gpt4 key购买 nike

我无法使用 iOS sdk 从 cloudinary 中删除图像,它一直要求我提供签名:

Optional(Error Domain=com.cloudinary.error Code=400 "(null)" UserInfo={message=Missing required parameter - signature})

要从我正在使用的 cloudinary 中删除图像:

let config = CLDConfiguration(cloudName: self.cloudname, apiKey: self.apiKey)
let cloudinary = CLDCloudinary(configuration: config)
print(self.separateIdFromUrl(url: (photo?.url)!))
_ = cloudinary.createManagementApi().destroy(self.separateIdFromUrl(url: (photo?.url)!))

最佳答案

我找到了解决方案
给它你的 photoUrl
检查this也是

func deletePhoto(url: String) {

let photoName = "folderName/" + String(describing: url.split(separator: "/").last!.split(separator: ".").first!)

let config = CLDConfiguration(cloudName: "CloudName", apiKey: "API-KEY", apiSecret: "API-SECRET", secure: true)
cloudinary = CLDCloudinary(configuration: config)

cloudinary.createManagementApi().destroy(photoName) { (response, err) in

print(response?.result)
}
}

关于swift - cloudinary swift 3 版本如何销毁图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48292343/

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