I am trying to create a Salesforce plugin in which I want to return data to JS from my java code (which is basically a background process) But it always gives me an error for the line this.sendJavascript (function name)
Below is the plugin code -
package com.salesforce.androidsdk.phonegap; import org.apache.cordova.api.CallbackContext; import org.apache.cordova.api.CordovaPlugin; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.content.Context; import android.content.Intent; import android.util.Log; public class Echo extends CordovaPlugin { private static final String TAG = "CordovaPlugin"; @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { Log.i(TAG,"inside execute method--->>>" + action + args + callbackContext); if (action.trim().equalsIgnoreCase("echo")) { Log.i(TAG,"args.getString(0)--->>>" + args.getString(0)); String message = args.getString(0);
I noted the error line that is at the end. Please help me solve this problem.
Thanks Advance, Cat
source share