diff --git a/src/android/JPushPlugin.java b/src/android/JPushPlugin.java index 0f2009d..3a3fbff 100644 --- a/src/android/JPushPlugin.java +++ b/src/android/JPushPlugin.java @@ -37,7 +37,7 @@ public class JPushPlugin extends CordovaPlugin { "setCustomPushNotificationBuilder", "setPushTime", "init", - "setDebugable", + "setDebugMode", "stopPush", "resumePush", "isPushStopped", @@ -143,7 +143,7 @@ public class JPushPlugin extends CordovaPlugin { callbackContext.success(); } - void setDebugable(JSONArray data, CallbackContext callbackContext) { + void setDebugMode(JSONArray data, CallbackContext callbackContext) { String mode; try { mode = data.getString(0); @@ -173,8 +173,8 @@ public class JPushPlugin extends CordovaPlugin { void isPushStopped(JSONArray data, CallbackContext callbackContext){ - boolean isStoped =JPushInterface.isPushStopped(this.cordova.getActivity().getApplicationContext()); - if(isStoped){ + boolean isStopped =JPushInterface.isPushStopped(this.cordova.getActivity().getApplicationContext()); + if(isStopped){ callbackContext.success(1); }else{ callbackContext.success(0); @@ -200,13 +200,13 @@ public class JPushPlugin extends CordovaPlugin { void setPushTime(JSONArray data, CallbackContext callbackContext){ Set days = new HashSet(); - JSONArray dayArr; + JSONArray dayArray; int startHour = -1; int endHour = -1; try { - dayArr = data.getJSONArray(0); - for (int i = 0; i < dayArr.length(); i++) { - days.add(dayArr.getInt(i)); + dayArray = data.getJSONArray(0); + for (int i = 0; i < dayArray.length(); i++) { + days.add(dayArray.getInt(i)); } } catch (JSONException e) { e.printStackTrace(); @@ -238,8 +238,8 @@ public class JPushPlugin extends CordovaPlugin { tags= new HashSet(); }else{ tagStr = data.getString(0); - String[] tagArr = tagStr.split(","); - for (String tag : tagArr) { + String[] tagArray = tagArray.split(","); + for (String tag : tagArray) { tags.add(tag); } } @@ -270,8 +270,8 @@ public class JPushPlugin extends CordovaPlugin { String alias; try { alias = data.getString(0); - JSONArray tagsArr = data.getJSONArray(1); - for (int i = 0; i < tagsArr.length(); i++) { + JSONArray tagsArray = data.getJSONArray(1); + for (int i = 0; i < tagsArray.length(); i++) { tags.add(tagsArr.getString(i)); } @@ -374,10 +374,6 @@ public class JPushPlugin extends CordovaPlugin { .format("cordova.fireDocumentEvent('jpush.setTagsWithAlias',%s)", data.toString()); instance.webView.sendJavascript(jsEvent); -// String js = String -// .format("window.plugins.jPushPlugin.pushCallback('%s');", -// data.toString()); -// instance.webView.sendJavascript(js); } catch (JSONException e) { diff --git a/www/JPushPlugin.js b/www/JPushPlugin.js index 5cd5912..0b0bb8b 100644 --- a/www/JPushPlugin.js +++ b/www/JPushPlugin.js @@ -74,15 +74,15 @@ JPushPlugin.prototype.setAlias = function(data){ } } -JPushPlugin.prototype.recieveMessageIniOSCallback = function(data){ +JPushPlugin.prototype.receiveMessageIniOSCallback = function(data){ try{ - console.log("JPushPlugin:recieveMessageIniOSCallback--data:"+data); + console.log("JPushPlugin:receiveMessageIniOSCallback--data:"+data); var bToObj = JSON.parse(data); var content = bToObj.content; console.log(content); } catch(exception){ - console.log("JPushPlugin:recieveMessageIniOSCallback"+exception); + console.log("JPushPlugin:receiveMessageIniOSCallback"+exception); } } // @@ -184,7 +184,7 @@ JPushPlugin.prototype.resumePush = function(){ } } -JPushPlugin.prototype.clearAllNoticication = function(){ +JPushPlugin.prototype.clearAllNotification = function(){ if(device.platform == "Android") { data=[] this.call_native("clearAllNotification",data,null); @@ -211,13 +211,13 @@ JPushPlugin.prototype.init = function(){ } } -JPushPlugin.prototype.setDebugable = function(mode){ +JPushPlugin.prototype.setDebugMode = function(mode){ if(device.platform == "Android") { - this.call_native("setDebugable",[mode],null); + this.call_native("setDebugMode",[mode],null); } } -//ios single +//iOS single if(!window.plugins){