早上好, 我正在尝试与WhatsApp共享音频文件。 但是当我创建相册时,我不知道如何获得正确的 Uri,并且当我尝试使用原始资产时,响应此错误。
[Unhandled promise rejection: Error: Failed to share the file: Failed to find configured root that contains /storage/emulated/0/DCIM/recording-027dc98c-b62b-4699-9dbd-fd075cecd87d.3gp]
谢谢你的时间
上的完整示例: https://snack.expo.io/@tilenozz/recorder (在第一次许可允许后稍等片刻,请稍等(
const asset = await MediaLibrary.createAssetAsync(this.recording.getURI());
MediaLibrary.createAlbumAsync('Sveglia_Social_App', asset)
.then(() => {
console.log(asset)
})
.catch(error => {
console.log('err', error);
});
Sharing.shareAsync(asset.uri)
你可以试试这个:
await Sharing.shareAsync(this.recording.getURI());
我不确定 3gp 格式是否支持在 Whatsapp 中共享。