修改设置角标数值及清除角标数值方法
This commit is contained in:
parent
e4e06a43a7
commit
1ec16cbbe5
@ -81,7 +81,7 @@ public class TpnsPlugin extends CordovaPlugin {
|
|||||||
void setBadgeNum(JSONArray data, CallbackContext callbackContext){
|
void setBadgeNum(JSONArray data, CallbackContext callbackContext){
|
||||||
int mode;
|
int mode;
|
||||||
try {
|
try {
|
||||||
mode = data.getInt(0);
|
mode =Integer.parseInt(data.getString(0));;
|
||||||
XGPushConfig.setBadgeNum(mContext,mode);
|
XGPushConfig.setBadgeNum(mContext,mode);
|
||||||
callbackContext.success();
|
callbackContext.success();
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
@ -90,19 +90,14 @@ public class TpnsPlugin extends CordovaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 直接设置角标数值
|
* 清除角标数值
|
||||||
* @param data
|
* @param data
|
||||||
* @param callbackContext
|
* @param callbackContext
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void resetBadgeNum(JSONArray data, CallbackContext callbackContext){
|
void resetBadgeNum(JSONArray data, CallbackContext callbackContext){
|
||||||
try {
|
XGPushConfig.resetBadgeNum(mContext);
|
||||||
XGPushConfig.setBadgeNum(mContext);
|
|
||||||
callbackContext.success();
|
callbackContext.success();
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
callbackContext.error(e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user