@capawesome/capacitor-pixlive 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,8 +58,10 @@ public class PixliveHelper {
58
58
  obj.put("imageHiResURL", context.getImageHiResURL() != null ? context.getImageHiResURL() : JSONObject.NULL);
59
59
  obj.put("notificationTitle", context.getNotificationTitle() != null ? context.getNotificationTitle() : JSONObject.NULL);
60
60
  obj.put("notificationMessage", context.getNotificationMessage() != null ? context.getNotificationMessage() : JSONObject.NULL);
61
- obj.put("tags", context.getTags() != null ? context.getTags() : new JSArray());
62
- obj.put("languages", context.getLanguages() != null ? context.getLanguages() : new JSArray());
61
+ JSArray tagsArray = arrayListToJSArray(context.getTags());
62
+ JSArray languagesArray = arrayListToJSArray(context.getLanguages());
63
+ obj.put("tags", tagsArray);
64
+ obj.put("languages", languagesArray);
63
65
  return obj;
64
66
  }
65
67
 
@@ -110,4 +112,15 @@ public class PixliveHelper {
110
112
  return "unknown";
111
113
  }
112
114
  }
115
+
116
+ @NonNull
117
+ private static JSArray arrayListToJSArray(@Nullable ArrayList<String> list) {
118
+ JSArray result = new JSArray();
119
+ if (list != null) {
120
+ for (String item : list) {
121
+ result.put(item);
122
+ }
123
+ }
124
+ return result;
125
+ }
113
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-pixlive",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Unofficial Capacitor plugin for Pixlive SDK.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",