firebase function get download url after successfully save image to firebase cloud storage

前端 未结 2 731
日久生厌
日久生厌 2020-12-19 12:18

I\'m having problem getting download url in firebase function after saving image to cloud storage. Below is my firebase http function in typescript to save base64 string to

2条回答
  •  鱼传尺愫
    2020-12-19 13:10

    Thanks @Doug Stevenson. I believe I found an answer.

    1. I solve deployment errors by recreating new project.

    2. I change my initialization to code below to solve unhandled rejection. Go to Service Acccounts under Project Settings in your firebase project and generate new private key under firebase admin sdk.

      const serviceAccount = require('./path/to/serviceaccount.json');
      admin.initializeApp({
        credential: admin.credential.cert(serviceAccount),
        databaseURL: '', // check it under service accounts
        storageBucket: '' //check it in script snippet require to add to your website.
      });
      

提交回复
热议问题