无法在iOS上选择Google云端硬盘文件

时间:2018-03-14 19:00:09

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

我正在使用 React Native this library来挑选应用中的文件。

原生 Google云端硬盘文件(文档,工作表,幻灯片)在 iOS 上开始显示无法选择,同时在Android上,它们似乎可以选择为PDF(似乎它们会自动转换,但对我来说没问题。)

unselectable files

它过去也适用于iOS。 还有一些Androids也发生了这种情况,但是在清理了Drive应用程序的缓存后,它开始工作,但是这种解决方法在iOS上不起作用。

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

2 个答案:

答案 0 :(得分:0)

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
  );
});

答案 1 :(得分:0)

可能为时已晚,但对其他人有帮助。我也面临着类似的问题。 ios不允许在应用程序中打开iCloud驱动器文档。 根据{{​​3}}

,在使用它们时必须定义一些系统声明的统一类型标识符。

在我的情况下,我选择pdf并使用react-native-document-picker库。

下面是工作代码-

 <div class="container">
        <div class="main-text">
            <h1>Smart Parking System UI</h1>
            <p>Currently viewing: <span class="lot-id">Beta</span></p>
        </div>
        <main>
            <div class="data-box">
                <p class="m-para">Parking Status</p>
                <p class="total-para">Total Seats:</p><span class="total-data">15</span>
                <p class="avail-para">Available: </p><span class="avail-data">12</span>
                <div class="location">
                        <p>Your Location:</p><i class="fas fa-map-marker-alt"></i><p>Asgard</p>
                </div>
            </div>
            <div class="display-box">
                <div class="lot-box inactive">1</div>
                <div class="lot-box">2</div>
                <div class="lot-box">3</div>
                <div class="lot-box">4</div>
                <div class="lot-box">5</div>
                <div class="lot-box">6</div>
                <div class="lot-box">7</div>
                <div class="lot-box">8</div>
                <div class="lot-box">9</div>
                <div class="lot-box inactive">10</div>
                <div class="lot-box inactive">11</div>
                <div class="lot-box">12</div>
                <div class="lot-box">13</div>
                <div class="lot-box">14</div>
                <div class="lot-box">15</div>

            </div>
        </main>
    </div>