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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top