Question

I am writing custom plugins for Phone Gap android app. Using cordova's PluginResult or CallbackContext, we can send string, byte array, JSON object or array to JavaScript success callback.

Is there any way we can pass some custom object like Person Or Employee or some complex object from Native(Java in my case) code to JS callback using cordova's PluginResult or CallbackContext? or any other way to achieve this?

Any inputs or example code snippets are most welcome.

Was it helpful?

Solution

You can pass only strings and objects, that can be serialized in strings, between native code and javascript parts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top