Skip to content

Commit 5be7129

Browse files
thatfiredevrlazo
authored andcommitted
feat: add docs for functions-ktx (#506)
1 parent 5e35f4a commit 5be7129

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ in your app:
2525

2626
* [`firebase-common`](ktx/common.md)
2727
* [`firebase-firestore`](ktx/firestore.md)
28+
* [`firebase-functions`](ktx/functions.md)
2829

2930
[android-setup]: https://firebase.google.com/docs/android/setup
3031
[main-readme]: https://github.com/firebase/firebase-android-sdk/blob/master/README.md

docs/ktx/functions.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Cloud Functions Kotlin Extensions
2+
3+
## Getting Started
4+
5+
To use the Cloud Functions Android SDK with Kotlin Extensions, add the following
6+
to your app's `build.gradle` file:
7+
8+
```groovy
9+
// See maven.google.com for the latest versions
10+
// This library transitively includes the firebase-functions library
11+
implementation 'com.google.firebase:firebase-functions-ktx:$VERSION'
12+
```
13+
14+
## Features
15+
16+
### Get the FirebaseFunctions instance of the default app
17+
18+
**Kotlin**
19+
```kotlin
20+
val functions = FirebaseFunctions.getInstance()
21+
```
22+
23+
**Kotlin + KTX**
24+
```kotlin
25+
val functions = Firebase.functions
26+
```
27+
28+
### Get the FirebaseFunctions of a given region
29+
30+
**Kotlin**
31+
```kotlin
32+
val functions = FirebaseFunctions.getInstance(region)
33+
```
34+
35+
**Kotlin + KTX**
36+
```kotlin
37+
val functions = Firebase.functions(region)
38+
```
39+
40+
### Get the FirebaseFunctions of a given FirebaseApp
41+
42+
**Kotlin**
43+
```kotlin
44+
val functions = FirebaseFunctions.getInstance(app)
45+
```
46+
47+
**Kotlin + KTX**
48+
```kotlin
49+
val functions = Firebase.functions(app)
50+
```
51+
52+
### Get the FirebaseFunctions of a given region and FirebaseApp
53+
54+
**Kotlin**
55+
```kotlin
56+
val functions = FirebaseFunctions.getInstance(app, region)
57+
```
58+
59+
**Kotlin + KTX**
60+
```kotlin
61+
val functions = Firebase.functions(app, region)
62+
```

0 commit comments

Comments
 (0)