Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Firebase for Android Development

You're reading from  Mastering Firebase for Android Development

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781788624718
Pages 394 pages
Edition 1st Edition
Languages
Author (1):
Ashok Kumar S Ashok Kumar S
Profile icon Ashok Kumar S
Toc

Table of Contents (23) Chapters close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. Keep It Real – Firebase Realtime Database 2. Safe and Sound – Firebase Authentication 3. Safe and Sound – Firebase Crashlytics 4. Genie in the Cloud – Firebase Cloud Functions 5. Arsenal for Your Files – Firebase Cloud Storage 6. Not Just a Keeper, Firebase Hosting 7. Inspection and Evaluation – Firebase Test Lab 8. A Smart Watchdog – Firebase Performance Monitoring 9. Application Usage Measuring and Notification, Firebase Analytics, and Cloud Messaging 10. Changing Your App – Firebase Remote Config and Dynamic Links 11. Bringing Everyone on the Same Page, Firebase Invites, and Firebase App Indexing 12. Making a Monetary Impact and Firebase AdMob and AdWords 13. Flexible NoSQL and Cloud Firestore 14. Analytics Data, Clairvoyant, Firebase Predictions 15. Training Your Code and ML Kit 1. Other Books You May Enjoy Index

Storage and functions 


We can trigger a cloud function in response to uploading, downloading or deleting files and folders in a storage bucket. To trigger a function for storage changes, developers can make use of functions.storage to create a function that handles storage events. Based on the use case, we can trigger cloud functions to a specific bucket or to the default bucket:

  • functions.storage.object() to listen for object changes on the default storage
  • functions.storage.bucket('bucketName').object() to listen for object changes on a particular bucket

For example, consider the code snippet of the functions:

exports.generateThumbnail = functions.storage.object().onChange((event)=>{
// ...
});

Most of the time, developers need not download or upload the files from storage. Sometimes, we might have to generate a thumbnail for the uploaded files. Cloud functions offer an efficient image processing program called ImageMagick that can perform most trivial image processing operations. Consider...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime