Skip to content

Instantly share code, notes, and snippets.

@niths
Created May 15, 2012 08:34
Show Gist options
  • Save niths/2700063 to your computer and use it in GitHub Desktop.
Save niths/2700063 to your computer and use it in GitHub Desktop.
PrivateStorage plugin
package com.phonegap.plugins.privateStorage;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;
/**
*
* @author NITHs
*
* Store your application secret key here
*
*/
public class PrivateStorage extends Plugin {
@Override
public PluginResult execute(String action, JSONArray data, String callbackId) {
JSONArray jsonRes = null;
try {
jsonRes = new JSONArray();
jsonRes.put(new JSONObject().put("devtoken", "your_devtoken"));
jsonRes.put(new JSONObject().put("apptoken","your_apptoken"));
} catch (JSONException e) {
Log.e("ERROR", e.getMessage());
}
return new PluginResult(PluginResult.Status.OK, jsonRes);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment