modifed JpushPlugin.java

This commit is contained in:
lincoln 2014-04-18 13:18:57 +08:00
parent 44b6858c90
commit 78e2267a29

View File

@ -109,17 +109,20 @@ public class JPushPlugin extends CordovaPlugin {
callbackContext.success(); callbackContext.success();
} }
void setDebugable(JSONArray data, void setDebugable(JSONArray data, CallbackContext callbackContext) {
CallbackContext callbackContext){ String mode;
String mode = data.getString(0); try {
if(mode.equals(true)){ mode = data.getString(0);
JPushInterface.setDebugMode(true); if (mode.equals("true")) {
}else if(mode.equals(false)){ JPushInterface.setDebugMode(true);
JPushInterface.setDebugMode(false); } else if (mode.equals("false")) {
}else{ JPushInterface.setDebugMode(false);
callbackContext.error("error mode"); } else {
callbackContext.error("error mode");
}
callbackContext.success();
} catch (JSONException e) {
} }
callbackContext.success();
} }
void stopPush(JSONArray data, void stopPush(JSONArray data,
@ -266,7 +269,7 @@ public class JPushPlugin extends CordovaPlugin {
void setCustomPushNotificationBuilder(JSONArray data, void setCustomPushNotificationBuilder(JSONArray data,
CallbackContext callbackContext) { CallbackContext callbackContext) {
CustomPushNotificationBuilder builder = new CustomPushNotificationBuilder( CustomPushNotificationBuilder builder = new CustomPushNotificationBuilder(
this.cordova.getActivity(), R.layout.test_notitfication_layout, this.cordova.getActivity(), R.layout.test_notification_layout,
R.id.icon, R.id.title, R.id.text); R.id.icon, R.id.title, R.id.text);
builder.developerArg0 = "Custom Builder 1"; builder.developerArg0 = "Custom Builder 1";
builder.layoutIconDrawable = R.drawable.jpush_notification_icon; builder.layoutIconDrawable = R.drawable.jpush_notification_icon;