1

Is it possible to pass Array to phonegap plugin in android from javascript interface ? Im using phonegap 2.7 version

1 Answer 1

3

Yes it is possible to pass array from Java Script to Native i.e Plugin

cordova.exec(function(winParam) {}, function(error) {}, "service", "action", ["firstArgument", "secondArgument", "thirdArgument",
                     "fourthArgument"]);

The parameters are detailed below:

function(winParam) {}: Success function callback. Assuming your exec call completes successfully, this function is invoked (optionally with any parameters you pass back to it).

function(error) {}: Error function callback. If the operation does not complete successfully, this function is invoked (optionally with an error parameter).

"service": The service name to call into on the native side. This is mapped to a native class, and it is defined in config.xml.

"action": The action name to call into. This is picked up by the native class receiving the exec call, and, depending on the platform, essentially maps to a class's method.

[Array of Data, separated by ',']: Arguments to pass into the native environment.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.