Skip to content

Commit a03ffec

Browse files
authored
docs(android): data types compatible with pubsub (#246)
1 parent 75d9bd8 commit a03ffec

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

website/docs/for-android/how-to/using-the-portals-plugin.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,17 @@ PortalsPubSub.getShared().publish("weather", "sunny");
380380

381381
</Tabs>
382382

383+
### Data Types
384+
385+
Data published through the `publish()` function from native should be a type compatible with objects in the [org.json](https://developer.android.com/reference/org/json/package-summary) package. Compatible types include:
386+
387+
- String
388+
- Numbers (e.g: integer)
389+
- [JSONObject](https://developer.android.com/reference/org/json/JSONObject)
390+
- [JSONArray](https://developer.android.com/reference/org/json/JSONArray)
391+
392+
The Capacitor [JSObject](https://github.com/ionic-team/capacitor/blob/main/android/capacitor/src/main/java/com/getcapacitor/JSObject.java) and [JSArray](https://github.com/ionic-team/capacitor/blob/main/android/capacitor/src/main/java/com/getcapacitor/JSArray.java) are also compatible.
393+
383394
## Examples
384395

385396
The `PortalsPlugin` is used in the [E-Commerce App](../examples/ecommerce-app) demo.

0 commit comments

Comments
 (0)