离子vue firebase存储在电容器iOS上getDownloadurl

发布于 2025-02-10 17:51:02 字数 1567 浏览 0 评论 0原文

我有一个使用Ionic 6 Vue 3创建的博客/帖子。 在帖子创建中,我们可以附加一个英制或附件文件 通过使用getDownloadurl函数调用收集项目

const url =等待GetDownloadurl(Ref(ref(recore,fileName))

这些存储在Firebase Collection上,可以使用Web轻松返回帖子中, 使用CAP SYNC iOS部署的所有日志记录之前,请通过iOS进行相同的例程 提取到自己的功能

 async GetDownloadUrl(fileName, ContentId, type) {
            console.log('attempting ',fileName,ContentId,type)
            const url = await getDownloadURL(ref(storage, fileName))
            console.log('Generated GET signed URL:');
            console.log(url);
            console.log('id',ContentId, 'and type ', type)
        }

Web返回之后(调用子函数,然后稍后获取响应我获得异步/等待)将在我获得iOS iOS

attempting  post/qv2Be2fBGcOzfSpW5jic/AugConnect22.png qv2Be2fBGcOzfSpW5jic HeroImg
main.js?ead5:187 Generated GET signed URL:
main.js?ead5:188 https://firebasestorage.googleapis.com/v0/b/dgsa-test.appspot.com/o/post%2Fo2QVuFVIIYIxlFn68c9y%2Fattachment%2FDaily%20Action%20Sheet.pdf?alt=media&token=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
main.js?ead5:189 id o2QVuFVIIYIxlFn68c9y and type  Attach

iOS返回上的URL后,将使用下载URL更新本地集合

⚡️  [log] - attempting  post/pxpA2TaXas1uuAVrgFDq/attachment/understanding_muscle_protein_dynamics_technical_co.pdf pxpA2TaXas1uuAVrgFDq Attach
⚡️  [log] - attempting  post/qL8sByCPSzRZtaEqTz2d/attachment/A-Virtual-Calendar-May_Jun_July-Expo.pdf qL8sByCPSzRZtaEqTz2d Attach
⚡️  [log] - attempting  post/qv2Be2fBGcOzfSpW5jic/AugConnect22.png qv2Be2fBGcOzfSpW5jic HeroImg```

Any ideas or suggestions appreciated

I have a blog/post that is being created using Ionic 6 Vue 3.
On the post creation we can attach a HeroImage or Attachment File
These are stored on the Firebase Collection and can be returned easily on the post using the Web by Calling the Collection item using the GetDownloadURL function

const url = await getDownloadURL(ref(storage, fileName))

When I call the same routine via IOS having deployed using Cap Sync IOS all the logging I do before this is invoked but nothing is returned in the IOS logs
Having extracted to it's own function

 async GetDownloadUrl(fileName, ContentId, type) {
            console.log('attempting ',fileName,ContentId,type)
            const url = await getDownloadURL(ref(storage, fileName))
            console.log('Generated GET signed URL:');
            console.log(url);
            console.log('id',ContentId, 'and type ', type)
        }

Web Returns (invokes the child function then gets the response later I get async/await) will update the local collection with download URLs once I get the URLs to resolve on IOS

attempting  post/qv2Be2fBGcOzfSpW5jic/AugConnect22.png qv2Be2fBGcOzfSpW5jic HeroImg
main.js?ead5:187 Generated GET signed URL:
main.js?ead5:188 https://firebasestorage.googleapis.com/v0/b/dgsa-test.appspot.com/o/post%2Fo2QVuFVIIYIxlFn68c9y%2Fattachment%2FDaily%20Action%20Sheet.pdf?alt=media&token=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
main.js?ead5:189 id o2QVuFVIIYIxlFn68c9y and type  Attach

IOS Returns

⚡️  [log] - attempting  post/pxpA2TaXas1uuAVrgFDq/attachment/understanding_muscle_protein_dynamics_technical_co.pdf pxpA2TaXas1uuAVrgFDq Attach
⚡️  [log] - attempting  post/qL8sByCPSzRZtaEqTz2d/attachment/A-Virtual-Calendar-May_Jun_July-Expo.pdf qL8sByCPSzRZtaEqTz2d Attach
⚡️  [log] - attempting  post/qv2Be2fBGcOzfSpW5jic/AugConnect22.png qv2Be2fBGcOzfSpW5jic HeroImg```

Any ideas or suggestions appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文