File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
androidTest/java/com/google/firebase/functions/ktx
main/java/com/google/firebase/functions Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
+ * [ fixed] Fixed HttpsCallableResult.data resolution in Kotlin
3
+
4
+ # 21.1.0
2
5
* [ changed] Migrated to Kotlin
3
6
4
7
# 21.0.0
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ package com.google.firebase.functions {
110
110
111
111
public final class HttpsCallableResult {
112
112
method @Nullable public Object getData();
113
+ field @Nullable public final Object data;
113
114
}
114
115
115
116
public final class Serializer {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class CallTests {
64
64
)
65
65
66
66
var function = functions.getHttpsCallable(" dataTest" )
67
- val actual = Tasks .await(function.call(input)).getData()
67
+ val actual = Tasks .await(function.call(input)).data
68
68
69
69
assertThat(actual).isInstanceOf(Map ::class .java)
70
70
@Suppress(" UNCHECKED_CAST" ) val map = actual as Map <String , * >
@@ -77,7 +77,7 @@ class CallTests {
77
77
fun testNullDataCall () {
78
78
val functions = Firebase .functions(app)
79
79
var function = functions.getHttpsCallable(" nullTest" )
80
- val actual = Tasks .await(function.call(null )).getData()
80
+ val actual = Tasks .await(function.call(null )).data
81
81
82
82
assertThat(actual).isNull()
83
83
}
@@ -86,7 +86,7 @@ class CallTests {
86
86
fun testEmptyDataCall () {
87
87
val functions = Firebase .functions(app)
88
88
var function = functions.getHttpsCallable(" nullTest" )
89
- val actual = Tasks .await(function.call()).getData()
89
+ val actual = Tasks .await(function.call()).data
90
90
91
91
assertThat(actual).isNull()
92
92
}
Original file line number Diff line number Diff line change @@ -16,13 +16,21 @@ package com.google.firebase.functions
16
16
/* * The result of calling a HttpsCallableReference function. */
17
17
public class HttpsCallableResult
18
18
internal constructor ( // The actual result data, as generic types decoded from JSON.
19
- private val data: Any? ) {
19
+ /* *
20
+ * The data that was returned from the Callable HTTPS trigger.
21
+ *
22
+ * The data is in the form of native Java objects. For example, if your trigger returned an array,
23
+ * this object would be a `List<Object>`. If your trigger returned a JavaScript object with keys
24
+ * and values, this object would be a `Map<String, Object>`.
25
+ */
26
+ @JvmField public val data: Any?
27
+ ) {
20
28
/* *
21
29
* Returns the data that was returned from the Callable HTTPS trigger.
22
30
*
23
31
* The data is in the form of native Java objects. For example, if your trigger returned an array,
24
- * this object would be a List<Object>. If your trigger returned a JavaScript object with keys and
25
- * values, this object would be a Map<String, Object>.
32
+ * this object would be a ` List<Object>` . If your trigger returned a JavaScript object with keys
33
+ * and values, this object would be a ` Map<String, Object>` .
26
34
*/
27
35
public fun getData (): Any? {
28
36
return data
You can’t perform that action at this time.
0 commit comments