如何获取Firebase存储URL [英] How to get Firebase storage URL

查看:70
本文介绍了如何获取Firebase存储URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用我写在Go中的后端发送带有图像链接的FCM通知.图像存储在Firebase存储中.我需要将存储桶路径解析为可用于创建FCM通知的Url.

I am sending FCM notifications with image links from my backend written in Go. The images are stored in Firebase-storage. I need to resolve the bucket path into a Url that I can use to create the FCM notification.

似乎有一个Javascript函数(getDownloadUrl)可以做到这一点.如何在Go中获取下载URL?

There seems to be a Javascript function (getDownloadUrl) to do this. How do I get the download URL in Go?

推荐答案

getDownloadUrl 是Firebase客户端SDK的一项功能,可读写云存储.后端和服务器SDK没有直接等效项.

getDownloadUrl is a feature of Firebase client SDKs that read and write Cloud Storage. There is no direct equivalent for backend and server SDKs.

Cloud Storage具有类似的概念,称为签名URL 可用于创建直接访问Cloud Storage中内容的URL.您可以按照文档中所示直接使用REST API,或者,如果您使用的是Go SDK,则只需调用

Cloud Storage has a similar concept called signed URLs that you can use to create URLs that directly access content in Cloud Storage. You can use the REST APIs directly as shown in the documentation, or if you're using the Go SDK, you can simply call SignedURL directly to get a URL that meets your specifications.

这篇关于如何获取Firebase存储URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆