From 9bdd458004d069f856cc9f007c9bb46a45f59afa Mon Sep 17 00:00:00 2001 From: Robert Mengual Date: Sun, 22 Dec 2024 20:01:40 +0100 Subject: [PATCH] fix(functions): Serialize array of arrays. (#781) * fix(functions): Serialize array of arrays. * Added changeset * Update .changeset/little-buses-hug.md --------- Co-authored-by: Robin Genz --- .changeset/little-buses-hug.md | 5 +++++ .../firebase/functions/classes/results/CallResult.java | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/little-buses-hug.md diff --git a/.changeset/little-buses-hug.md b/.changeset/little-buses-hug.md new file mode 100644 index 00000000..503c8ec2 --- /dev/null +++ b/.changeset/little-buses-hug.md @@ -0,0 +1,5 @@ +--- +'@capacitor-firebase/functions': patch +--- + +fix(android): serialize arrays in arrays correctly diff --git a/packages/functions/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/functions/classes/results/CallResult.java b/packages/functions/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/functions/classes/results/CallResult.java index d34555b1..80c23f1e 100644 --- a/packages/functions/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/functions/classes/results/CallResult.java +++ b/packages/functions/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/functions/classes/results/CallResult.java @@ -59,6 +59,8 @@ private static JSArray createJSArrayFromArrayList(ArrayList arrayList) { for (Object value : arrayList) { if (value instanceof Map) { value = createJSObjectFromMap((Map) value); + } else if (value instanceof ArrayList) { + value = createJSArrayFromArrayList((ArrayList) value); } array.put(value); }