Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new downloadFile API to the Storage plugin to download protected files without generating a public download URL, using platform-appropriate mechanisms (native file download on Android/iOS; Blob download on Web).
Changes:
- Added
downloadFile(options, callback)to the public plugin interface and docs. - Implemented Web download via Firebase Storage
getBlob, returning theBlobvia callback. - Implemented native downloads: Android uses
StorageReference.getFile(uri); iOS usesStorageReference.write(toFile:), both emitting progress callbacks.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/storage/src/web.ts | Adds Web implementation of downloadFile using getBlob. |
| packages/storage/src/definitions.ts | Extends public API with downloadFile types/options/callback events. |
| packages/storage/ios/Plugin/FirebaseStoragePlugin.swift | Exposes downloadFile as a callback-style Capacitor method on iOS. |
| packages/storage/ios/Plugin/FirebaseStorage.swift | Implements iOS download using write(toFile:) with progress/success/failure observers. |
| packages/storage/ios/Plugin/Classes/Options/DownloadFileOptions.swift | Adds iOS options container for downloadFile. |
| packages/storage/ios/Plugin/Classes/Events/DownloadFileCallbackEvent.swift | Adds iOS callback event serialization for progress/completion. |
| packages/storage/android/src/main/java/.../FirebaseStoragePlugin.java | Exposes downloadFile as a callback-style Capacitor method on Android. |
| packages/storage/android/src/main/java/.../FirebaseStorage.java | Implements Android download using getFile(uri) with progress/success/failure listeners. |
| packages/storage/android/src/main/java/.../classes/options/DownloadFileOptions.java | Adds Android options container for downloadFile. |
| packages/storage/android/src/main/java/.../classes/events/DownloadFileCallbackEvent.java | Adds Android callback event serialization including bytes/progress. |
| packages/storage/android/src/main/java/.../enums/DownloadFileState.java | Adds Android state enum to compute completed. |
| packages/storage/README.md | Documents the new downloadFile API and related types. |
| .changeset/brave-dogs-cheer.md | Declares a minor bump for the new feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/storage/ios/Plugin/Classes/Events/DownloadFileCallbackEvent.swift
Show resolved
Hide resolved
...ndroid/src/main/java/io/capawesome/capacitorjs/plugins/firebase/storage/FirebaseStorage.java
Outdated
Show resolved
Hide resolved
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
downloadFilemethod to the Cloud Storage plugin that downloads files directly from Firebase Storage without generating a public download URLurioptionBlobusing Firebase'sgetBloband returned in the callback eventuploadFile)Close #665