
Streamlines Firebase integration for mobile apps, allowing effortless initialization and file management operations like upload, download, and deletion across platforms.
KFirebaseStorage is a Kotlin Multiplatform library designed to streamline the integration of Firebase services in your mobile applications. With this library, developers can effortlessly initialize Firebase for both Android and iOS, enabling a unified and efficient development experience.
KFirebaseStorage available on mavenCentral().
implementation("io.github.the-best-is-best:kfirebase-storage:2.1.0")| KFirebaseCrashlytics Version | Firebase iOS SDK | Minimum iOS Version | Minimum Android Version |
|---|---|---|---|
| 1.1.0 | Firebase v11.x | iOS 13+ | 21 |
| 2.0.0 | Firebase v12.x | iOS 15+ | 23 |
AndroidKFirebaseCore.initialization(this)Make sure to add Firebase as a dependency using Swift Package Manager (SPM) instead of CocoaPods.
File > Add Packages....https://github.com/firebase/firebase-ios-sdk
FirebaseCore and add it to your project.import Firebase
FirebaseApp.configure() ElevatedButton(
onClick = {
scope.launch {
val image = FileKit.openFilePicker(type = FileKitType.Image)
if (image != null) {
val res = firebaseStorage.uploadFile(
"test/${image.name}",
image.readBytes(),
)
res.fold(
onSuccess = {
println("Upload successful: $it")
},
onFailure = {
println("Error: ${it.message}")
}
)
}
}
}
) {
Text("Upload Image")
}
ElevatedButton(
onClick = {
scope.launch {
val res = firebaseStorage.getFileBytes("test/IMG_0002.jpeg")
res.fold(
onSuccess = {
val path = saveBytes(it, "IMG_0002.jpeg", "test")
try {
openFile(path)
} catch (e: Exception) {
println("Error opening file: ${e.message}")
}
},
onFailure = {
println("Error: ${it.message}")
}
)
}
}
) {
Text("Download Image by bytes")
}
ElevatedButton(
onClick = {
scope.launch {
firebaseStorage.deleteFile(
"test/IMG_0002.jpeg",
)
}
}
) {
Text("Delete Image")
}
🛡 License Licensed under the Apache 2.0 License.
KFirebaseStorage is a Kotlin Multiplatform library designed to streamline the integration of Firebase services in your mobile applications. With this library, developers can effortlessly initialize Firebase for both Android and iOS, enabling a unified and efficient development experience.
KFirebaseStorage available on mavenCentral().
implementation("io.github.the-best-is-best:kfirebase-storage:2.1.0")| KFirebaseCrashlytics Version | Firebase iOS SDK | Minimum iOS Version | Minimum Android Version |
|---|---|---|---|
| 1.1.0 | Firebase v11.x | iOS 13+ | 21 |
| 2.0.0 | Firebase v12.x | iOS 15+ | 23 |
AndroidKFirebaseCore.initialization(this)Make sure to add Firebase as a dependency using Swift Package Manager (SPM) instead of CocoaPods.
File > Add Packages....https://github.com/firebase/firebase-ios-sdk
FirebaseCore and add it to your project.import Firebase
FirebaseApp.configure() ElevatedButton(
onClick = {
scope.launch {
val image = FileKit.openFilePicker(type = FileKitType.Image)
if (image != null) {
val res = firebaseStorage.uploadFile(
"test/${image.name}",
image.readBytes(),
)
res.fold(
onSuccess = {
println("Upload successful: $it")
},
onFailure = {
println("Error: ${it.message}")
}
)
}
}
}
) {
Text("Upload Image")
}
ElevatedButton(
onClick = {
scope.launch {
val res = firebaseStorage.getFileBytes("test/IMG_0002.jpeg")
res.fold(
onSuccess = {
val path = saveBytes(it, "IMG_0002.jpeg", "test")
try {
openFile(path)
} catch (e: Exception) {
println("Error opening file: ${e.message}")
}
},
onFailure = {
println("Error: ${it.message}")
}
)
}
}
) {
Text("Download Image by bytes")
}
ElevatedButton(
onClick = {
scope.launch {
firebaseStorage.deleteFile(
"test/IMG_0002.jpeg",
)
}
}
) {
Text("Delete Image")
}
🛡 License Licensed under the Apache 2.0 License.