1. Introduction
Description: This extension uses latest Firebase Storage SDK [20.2.1] and Firebase Auth SDK [22.2.0] to integrate its features in your app. You can easily do these operations:
- upload file
- download file
- list files
- delete file
- get metadata of files
.... and all basic authentication features which includes
- Sign up with email & password
- Login with email & password
- Login with Google
- Sign In with Phone Number
- Get User info
- Update User info (Profile, Email, Password)
- Verify Email address with link
- Send password reset link on email
- Get Id Token
- Delete user
Latest Version: 3.1
Released: 2023-09-07T18:30:00Z
Last Updated: 2023-11-08T18:30:00Z
2. Blocks
3. Docs
Events
UploadFailed | Event raised when uploading failsfile | text errorMsg | text |
UploadProgress | Event raised when upload progress changesfile | text bytesTransferred | number totalBytes | number |
FileUploaded | Event raised after file has been uploadedfile | text fileName | text downloadUrl | text |
GotMetadata | Event raised after getting metadata. If any error occurred then dictionary will have single key named 'errorMsg'.metadataDict | dictionary |
DownloadSuccessful | Event indicating file has been downloadedfileName | text outputPath | text |
DownloadFailed | Event indicating file downloading has failedfileName | text errorMsg | text |
GotFilesList | Event raised after getting files listlist | list |
FileDeleted | Event raised after getting delete response. If successful then response will be empty, otherwise error msg.successful | boolean response | text |
GetUserInfoFailed | Event raised if some error occurred while getting user info |
GotUserInfo | Event raised after getting user infoprovider | text userId | text name | text email | text profilePicture | text phoneNumber | text |
GotIdToken | Event raised after getting Id Token of current usertoken | text |
SignUpSuccessful | Event raised if sign up was successfulprovider | text userId | text name | text email | text profilePicture | text phoneNumber | text |
SignUpFailed | Event raised if sign up failederrorMsg | text |
LoginSuccessful | Event raised if login was successful and provides user infoprovider | text userId | text name | text email | text profilePicture | text phoneNumber | text |
LoginFailed | Event raised when login failedprovider | text errorMsg | text |
UserUpdateFailed | Event raised when some error occurred while updating usertype | text errorMsg | text |
UserUpdateSuccess | Event raised when user info was successfully updatedtype | text |
UserDeletedResult | Event raised after getting DeleteUser resultsuccessful | boolean |
OtpSent | Event raised when OTP has been sent |
Methods
Init | Initializes firebase storage with provided credentialsprojectId | text apiKey | text storageBucket | text appId | text oauthKey | text |
Upload | Uploads file from given path/urifilePath | text fileName | text |
BucketName | Returns storage bucket name |
GetMetadata | Tries to get metadata of filefileName | text |
Download | Tries to download specified file to output path/uri. If providing Uri as output then make sure to create the file first with SAF. If path provided then file will be created if it doesn't exixt.fileName | text outputPath | text |
ListFiles | Gets a list of files in specified folder. For root folder provide '/' as argument.folder | text |
Delete | Delets specified filefileName | text |
PauseDownloads | Pause all active downloads |
ResumeDownloads | Resume all download tasks |
PauseUploads | Pause all upload tasks |
SignUpWithEmail | Sign up with email and passwordemail | text password | text |
IsSignedIn | Return whether there is an active user or not |
GetUserInfo | Tries to get user info of currently signed user |
GetIdToken | Tries to get id token |
LoginWithEmail | Login user with email and passwordemail | text password | text |
LoginWithGoogle | Login the user with Google |
SignOut | Sign out the currently signed user |
UpdateEmail | Update the email address of current useremail | text |
UpdateProfile | Update display name and profile picture of current userdisplayName | text photoUrl | text |
VerifyEmail | Send email for verification |
SendPasswordResetEmail | Sends password reset email |
UpdatePassword | Updates the password of currently signed usernewPassword | text |
DeleteUser | Deletes currently signed user |
SignInWithPhone | Sign in user with Phone NumberphoneNumber | text |
VerifyPhoneNumber | Verify OTP to sign in with Phone Numberotp | text |
Properties
4. Usages
Init
You can easily find these credentials in google-services.json
file which you get after adding your app to Firebase project and adding Auth + Storage features.
Upload
Image will be uploaded in test
subfolder. Use /
as prefix (eg. /sample.jpg
) to upload files into root folder.
List Files, Get Metadata and Download
metadata dictionary keys
- downloadUrl
- contentDisposition
- contentEncoding
- contentType
- timeCreated
- updated
- size
Values may contain \
, make sure to remove it
5. Download
v1 aix: com.sunny.fs.aix (~ 1.9 mb)
v3 and v3.1 aix can be downloaded from my site.
Thank you.
Hope it helps!