【问题标题】:Unable to select Google Drive files on iOS无法在 iOS 上选择 Google Drive 文件
【发布时间】:2018-03-14 19:00:09
【问题描述】:

我正在使用 React Nativethis library 在我的应用中选择文件。

原生 Google 云端硬盘 文件(文档、表格、幻灯片)在 iOS 上开始显示为不可选择,而在 Android 上它们似乎可以选择为PDF(似乎它们是自动转换的,但对我来说没关系)。

它曾经也可以在 iOS 上运行。 有一些 Android 设备也会发生这种情况,但在清除 Drive 应用程序的缓存后它开始工作,但这种解决方法在 iOS 上不起作用。

我想知道一种让它再次工作的方法。

【问题讨论】:

  • 您在做什么来访问云端硬盘?这里只显示 iCloud Drive。

标签: ios react-native google-drive-api filepicker


【解决方案1】:

可能为时已晚,但对其他人会有所帮助。我也面临着类似的问题。 Ios 不允许在应用程序中打开 iCloud 驱动器文档。 根据https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html,您必须在使用它们时定义一些系统声明的统一类型标识符

在我的例子中,我选择了 pdf 并使用 react-native-document-picker 库。

下面是工作代码 -

  DocumentPicker.show({
filetype: [DocumentPickerUtil.pdf(),'public.composite-content'],
},(error,res) => {
  console.log(res) 
}); 
}

【讨论】:

  • 还是不行。它只显示 iCloud Drive,我需要访问相机胶卷
【解决方案2】:
DocumentPicker.show({
  filetype: [DocumentPickerUtil.images()], ->> this may be where you specify type
},(error,res) => {
  // Android
  console.log(
     res.uri,
     res.type, // mime type
     res.fileName,
     res.fileSize
  );
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-03
    • 1970-01-01
    • 1970-01-01
    • 2018-06-18
    • 2020-09-17
    相关资源
    最近更新 更多