Skip to content

Commit 45965dc

Browse files
committed
Add FirebaseStorage
1 parent bb9245d commit 45965dc

4 files changed

Lines changed: 48 additions & 3 deletions

File tree

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public class com.simplejnius.sjfirebase.SJFirebaseFirestore
7171
##### Visit [FirebaseFirestore Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore) for more API
7272

7373
#### SJFirebaseUser
74+
```java
75+
public class com.simplejnius.sjfirebase.SJFirebaseUser
76+
```
7477
Represents a user's profile information in your Firebase project's user database.
7578
It also contains helper methods to change or retrieve profile information,
7679
as well as to manage that user's authentication state.
@@ -79,4 +82,24 @@ as well as to manage that user's authentication state.
7982
**methods**
8083
- get_current_user
8184
- profile_change_request_builder
82-
##### Visit [FirebaseUser Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser) for more API
85+
##### Visit [FirebaseUser Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser) for more API
86+
87+
#### SJFirebaseStorage
88+
```java
89+
public class com.simplejnius.sjfirebase.SJFirebaseStorage
90+
```
91+
FirebaseStorage is a service that supports uploading and downloading large objects to Google Cloud
92+
Storage. Pass a custom instance of [FirebaseApp]
93+
(https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp?authuser=0)
94+
to get_instance which will initialize it with a
95+
storage location (bucket) specified via [setStorageBucket]
96+
(https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseOptions.Builder?authuser=0#setStorageBucket(java.lang.String)).
97+
98+
Otherwise, if you call getReference without a FirebaseApp, the FirebaseStorage instance will
99+
initialize with the default FirebaseApp obtainable from getInstance.
100+
The storage location in this case will come the JSON configuration file downloaded from the web.
101+
(**NOTE** ignore `getInstance` on firebase documentation and use `get_instance`).
102+
103+
**methods**
104+
- get_instance
105+
##### Visit [FirebaseStorage Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/storage/FirebaseStorage?authuser=0) for more API

buildSrc/src/main/java/Coordinates.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object AppCoordinates {
88
}
99

1010
object LibraryAndroidCoordinates {
11-
const val LIBRARY_VERSION = "1.0.0"
11+
const val LIBRARY_VERSION = "1.1.0"
1212
const val LIBRARY_VERSION_CODE = 1
1313
}
1414

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ android.useAndroidX=true
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
# kotlin.code.style=official
22-
version=1.0.0
22+
version=1.1.0
2323
# kotlin.stdlib.jdk.variants.substitution=false
2424

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.simplejnius.sjfirebase;
2+
3+
import com.google.firebase.FirebaseApp;
4+
import com.google.firebase.storage.FirebaseStorage;
5+
6+
public class SJFirebaseStorage {
7+
public static FirebaseStorage get_instance() {
8+
return FirebaseStorage.getInstance();
9+
}
10+
11+
public static FirebaseStorage get_instance(String url) {
12+
return FirebaseStorage.getInstance(url);
13+
}
14+
15+
public static FirebaseStorage get_instance(FirebaseApp app) {
16+
return FirebaseStorage.getInstance(app);
17+
}
18+
19+
public static FirebaseStorage get_instance(FirebaseApp app, String url) {
20+
return FirebaseStorage.getInstance(app, url);
21+
}
22+
}

0 commit comments

Comments
 (0)