Site icon Android Tutorial Online

Ktor Plugin to simplify connecting ktor to firebase admin

Firetor

Firetor is Ktor plugin to help you simplified connecting to firebase admin

Dependency

Firetor was distributed through jitpack and this sample is using gradle.kts file.

Configured this code in build.gradle.kts

repositories {
    ...
    maven("https://jitpack.io")
}
dependencies {
    ...
    implementation("com.github.KylixEza:firetor:$firetor_version")
}

firetor_version depends on released tag, you can check released tag in jitpack banner above.

Setup

This is some steps to configure Firetor:

Firetor.kt

fun Application.configureFiretor() {
    install(Firetor) {
        setAdminKey("your-admin-key-file-name.json")
        setBasicConfiguration {
            //Setup other Firebase Options configuration manually
        }
    }
}
FunctionParametersParameter TypeExampleMandatory
setAdminKey()fileNameString“firetor-sample-admin-key.json”Yes
enableFirebaseStorage()bucketUrlString“firetor-sample.appspot.com”No
setBasicConfiguration()configFirbaseOptions.Builder.() -> FirebaseOptions.Builder?setDatabaseUrl(“”)No

Application.kt

fun main() {
    ...
}

fun Application.module() {
    ...
    configureFiretor()
}

Firetor still has access to configure other firebase options such as setDatabaseUrl, setThreadManager, setGoogleCredendtials, etc. But you need to setup that manually through setBasicConfiguration() function and you can write your own code as stated in firebase’s documentation

Features

Contributing

Please fork this repository and contribute back using pull request.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

Contact

Don’t forget to ⭐ this repository to motivates me to share more open source library

GitHub

View Github

Exit mobile version