box-api - Box iOS SDK : No on. 用于预览的进度回调 With Callbacks

标签 box-api

下载文件时,我没有收到 on.progress 回调,因此无法显示进度条。适合文件上传。

我做错了什么?

谢谢, 皮特

BoxFile *boxFile = (BoxFile *)boxObject;

[boxFile previewWithCallbacks:^(id<BoxOperationCallbacks> on)
{
    on.progress(^(NSNumber *ratio)
    {
        // update progress bar
    });

    on.after(^(BoxCallbackResponse response)
    {
         if (response == BoxCallbackResponseSuccessful)
         {

最佳答案

我们有同样的问题,但我们设法找到了答案,尽管我们还没有尝试实现它。

"Currently, the expected method to get progress on file downloads is to register your object as an observer of the download queue ([Box registerObserverForDownloadQueue:self];) and then to extend the BoxObserver protocol and implement any of these callback methods that you are interested in:

- (void)downloadDidBeginForItem:(BoxID *)itemID;
- (void)downloadDidProgressForItem:(BoxID *)itemID bytesDownloaded:(NSUInteger)bytes;
- (void)downloadDidCompleteForItem:(BoxID *)itemID withResponse:(BoxCallbackResponse)response;
- (void)downloadDidCompleteForAllItems;

Please remember to remove your object from the observers before you expect your object to be deallocated because observers are currently retained."

关于box-api - Box iOS SDK : No on. 用于预览的进度回调 With Callbacks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13518337/

相关文章:

c# - 使用 Box, Inc c# sdk 创建多个文件夹抛出 "Parameter count mismatch."异常

javascript - 如何使用ajax请求从box.com服务获取文件内容?

javascript - box api 错误获取访问 token : Invalid grant_type parameter or parameter missing

box-api - 当文件超过 3MB 时,上传 api 失败并抛出以下异常

java - 如何在 Box Api 中通过渐进式下载提供渐进式音频流

ruby - 如何在没有服务器的情况下完成此 OAuth 过程?

multithreading - 如何在多线程应用程序中刷新OAUTH2 BOX token

python - 如何将 Python Keyring 与 Box API OAuth2 结合使用?