【发布时间】:2020-01-14 03:58:54
【问题描述】:
AndroidManifest.xml
<meta-data
android:name="CLOUDINARY_URL"
android:value="${cloudinaryUrl}" />
在我上传文件的活动中,我初始化了 MediaManager
MediaManager.init(this);
我已经使用它的 uri 上传了文件:
val requestId = MediaManager.get().upload(uri).callback(object : UploadCallback {
override fun onStart(requestId: String) {
// your code here
}
override fun onProgress(requestId: String, bytes: Long, totalBytes: Long) {
// example code starts here
val progress = bytes.toDouble() / totalBytes
// post progress to app UI (e.g. progress bar, notification)
// example code ends here
}
override fun onSuccess(requestId: String, resultData: Map<*, *>) {
// your code here
}
override fun onError(requestId: String, error: ErrorInfo) {
// your code here
}
override fun onReschedule(requestId: String, error: ErrorInfo) {
// your code here
}
}).dispatch()
问题是我收到错误'Missing api key'。未签名的上传是否需要 api 密钥?
【问题讨论】:
-
是的,您的实施需要 CLOUDINARY_URL
-
@sohel.eco 我已将 CLOUDINARY_URL 添加到清单元数据中。错误说明缺少 api_key。
-
你能在这里给出你的确切错误吗?
-
"必须提供 api_key" - 完整的错误描述
标签: android cloudinary