修改设置角标数值及清除角标数值方法

This commit is contained in:
翟迪 2023-08-16 19:42:04 +08:00
parent e4e06a43a7
commit 1ec16cbbe5

View File

@ -81,7 +81,7 @@ public class TpnsPlugin extends CordovaPlugin {
void setBadgeNum(JSONArray data, CallbackContext callbackContext){
int mode;
try {
mode = data.getInt(0);
mode =Integer.parseInt(data.getString(0));;
XGPushConfig.setBadgeNum(mContext,mode);
callbackContext.success();
} catch (JSONException e) {
@ -90,19 +90,14 @@ public class TpnsPlugin extends CordovaPlugin {
}
}
/**
* 直接设置角标数值
* 清除角标数值
* @param data
* @param callbackContext
*/
void resetBadgeNum(JSONArray data, CallbackContext callbackContext){
try {
XGPushConfig.setBadgeNum(mContext);
XGPushConfig.resetBadgeNum(mContext);
callbackContext.success();
} catch (JSONException e) {
e.printStackTrace();
callbackContext.error(e.getLocalizedMessage());
}
}
/**