gpt4 book ai didi

ios - Dropbox Chooser 无法快速处理链接 ios

转载 作者:可可西里 更新时间:2023-11-01 02:26:07 26 4
gpt4 key购买 nike

我试图在我的 ios/swift 项目中实现 Dropbox Chooser 框架。一切看起来都很好。但是从 Dropbox 选择文件时我无法收到链接。只有我在 Dropbox 应用程序中看到带有文本“正在生成链接”的对话框一秒钟。我的问题在哪里?抱歉我的英语不好。

这是我的 UIViewController 中的按钮:

func dropboxBtn(sender: AnyObject) {
// println("dropboxBtn")
let dbChooser = DBChooser(appKey: "drop-in-app-key")
dbChooser.openChooserForLinkType(DBChooserLinkTypePreview, fromViewController: self, completion: { (results: [AnyObject]!) -> Void in
println(results.description)
})

}

这是我在 AppDelegate.swift 中的应用程序函数

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {

println("openURL")
let dbChooser = DBChooser(appKey: "drop-in-app-key")
if (dbChooser.handleOpenURL(url)) {
return true
}

return false

}

我在控制台中没有收到任何信息...

最佳答案

我发现了我的问题!我忘记了这个配置 -> 在 URL 方案中输入 db-APP_KEY(将 APP_KEY 替换为您创建应用程序时生成的 key )。现在我的方法改变了。在我的 UIViewController 中:

func dropboxBtn(sender: AnyObject) {

DBChooser.defaultChooser().openChooserForLinkType(DBChooserLinkTypePreview, fromViewController: self, completion: { (results: [AnyObject]!) -> Void in
println(results.description)
})
}

在我的 AppDelegate.swift 中:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {

if (DBChooser.defaultChooser().handleOpenURL(url)) {
return true
}
return false
}

关于ios - Dropbox Chooser 无法快速处理链接 ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27946870/

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