0
votes
  1. How do I upload to a Google Cloud Storage bucket, not the Firebase Storage? According to this documentation , the way you get a reference to the Firebase storage and Cloud storage seem to be exactly the same. But, when I try to access the bucket from Cloud Function, I am given two choices (gcf-sources-234340858426-us-central1 and us.artifacts.233093489-23.appspot.com) that are completely different from the Firebase Storage (gs://someaddress.appspot.com). I'm currently able to upload to Firebase storage with the Firebase SDK from the front end.

  2. Can Firebase Storage trigger Google Cloud Function with event triggers?

1
Firebase is an integrated platform for web services including a number of services designed to work together plus excellent mobile support. Google Cloud is a much larger platform designed to support the development of anything and everything. Firebase Storage and Cloud Storage are the same service. This article might help you understand: medium.com/google-developers/…John Hanley
But, how do I upload files to Google Cloud Storage? When I initialize the Firebase account and download the iOS SDK, the uploaded files go to the Firebase Storage. I tried modifying GoogleService-Info.plist by changing the STORAGE_BUCKET to a Google Cloud Storage bucket, but I get only an error.Kevvv
I cannot answer that part as I do not develop for mobile (Android/iOS).John Hanley

1 Answers

1
votes

Uploading Files

Cloud Storage buckets and Firebase buckets are the same thing under the hood. That said, if you want to use the Google Cloud-specific (i.e. non-Firebase) approach, you can use the client libraries or the REST API.

Triggering functions

Yes - you should be able to trigger a Storage-triggered function by uploading files to a bucket. The deployment command might look something like this:

# Note: this is untested, and assumes you have the Google Cloud SDK installed
gcloud functions deploy my-function --trigger-bucket "someaddress.appspot.com"

Hope this helps!