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 11# Unreleased
2+ * [ fixed] Fixed HttpsCallableResult.data resolution in Kotlin
3+
4+ # 21.1.0
25* [ changed] Migrated to Kotlin
36
47# 21.0.0
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ package com.google.firebase.functions {
110110
111111 public final class HttpsCallableResult {
112112 method @Nullable public Object getData();
113+ field @Nullable public final Object data;
113114 }
114115
115116 public final class Serializer {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class CallTests {
6464 )
6565
6666 var function = functions.getHttpsCallable(" dataTest" )
67- val actual = Tasks .await(function.call(input)).getData()
67+ val actual = Tasks .await(function.call(input)).data
6868
6969 assertThat(actual).isInstanceOf(Map ::class .java)
7070 @Suppress(" UNCHECKED_CAST" ) val map = actual as Map <String , * >
@@ -77,7 +77,7 @@ class CallTests {
7777 fun testNullDataCall () {
7878 val functions = Firebase .functions(app)
7979 var function = functions.getHttpsCallable(" nullTest" )
80- val actual = Tasks .await(function.call(null )).getData()
80+ val actual = Tasks .await(function.call(null )).data
8181
8282 assertThat(actual).isNull()
8383 }
@@ -86,7 +86,7 @@ class CallTests {
8686 fun testEmptyDataCall () {
8787 val functions = Firebase .functions(app)
8888 var function = functions.getHttpsCallable(" nullTest" )
89- val actual = Tasks .await(function.call()).getData()
89+ val actual = Tasks .await(function.call()).data
9090
9191 assertThat(actual).isNull()
9292 }
Original file line number Diff line number Diff line change @@ -16,13 +16,21 @@ package com.google.firebase.functions
1616/* * The result of calling a HttpsCallableReference function. */
1717public class HttpsCallableResult
1818internal 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+ ) {
2028 /* *
2129 * Returns the data that was returned from the Callable HTTPS trigger.
2230 *
2331 * 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>` .
2634 */
2735 public fun getData (): Any? {
2836 return data
You can’t perform that action at this time.
0 commit comments