Skip to content

feat: add docs for functions-ktx #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ in your app:

* [`firebase-common`](ktx/common.md)
* [`firebase-firestore`](ktx/firestore.md)
* [`firebase-functions`](ktx/functions.md)

[android-setup]: https://firebase.google.com/docs/android/setup
[main-readme]: https://github.com/firebase/firebase-android-sdk/blob/master/README.md
62 changes: 62 additions & 0 deletions docs/ktx/functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Cloud Functions Kotlin Extensions

## Getting Started

To use the Cloud Functions Android SDK with Kotlin Extensions, add the following
to your app's `build.gradle` file:

```groovy
// See maven.google.com for the latest versions
// This library transitively includes the firebase-functions library
implementation 'com.google.firebase:firebase-functions-ktx:$VERSION'
```

## Features

### Get the FirebaseFunctions instance of the default app

**Kotlin**
```kotlin
val functions = FirebaseFunctions.getInstance()
```

**Kotlin + KTX**
```kotlin
val functions = Firebase.functions
```

### Get the FirebaseFunctions of a given region

**Kotlin**
```kotlin
val functions = FirebaseFunctions.getInstance(region)
```

**Kotlin + KTX**
```kotlin
val functions = Firebase.functions(region)
```

### Get the FirebaseFunctions of a given FirebaseApp

**Kotlin**
```kotlin
val functions = FirebaseFunctions.getInstance(app)
```

**Kotlin + KTX**
```kotlin
val functions = Firebase.functions(app)
```

### Get the FirebaseFunctions of a given region and FirebaseApp

**Kotlin**
```kotlin
val functions = FirebaseFunctions.getInstance(app, region)
```

**Kotlin + KTX**
```kotlin
val functions = Firebase.functions(app, region)
```