在告诉用户文件已成功上传之前,请确保 Google Drive Android API 上传存储在服务器中

Making sure a Google Drive Android API upload is stored in the server before telling the user that a file has been uploaded successfully

我正在使用 Google Drive Android API 为用户文件提供自动上传到 Google Drive 的功能。我按照 the sample 创建和提供文件内容。

最后一次通话:

final DriveFolder.DriveFileResult fileResult = folder.createFile(client, originalMetadata, contents).await();

我认为应该提交 快速创建新文件 returns,但如果我立即断开设备并访问 Google 驱动器在网络上,我看到该文件实际上并没有存储在服务器中。仅存储在设备上,等待稍后同步。

(显然,如果我重新连接并等待一段时间,上传的文件会出现在 Google 网络驱动器上。)

我的应用程序只知道文件已经提交并显示"Google Drive Upload was successful"但实际上它还没有存储在服务器上。误导用户。

使用 Dropbox API 当它说提交时,它已经真正存储在服务器上了。我怎样才能获得与 Google Drive API 相同的确定性?

我想你要找的是完成事件? https://developers.google.com/drive/android/completion