问题如图示:
通知角标.png解决之代码:
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
//获取应用图标的数量
var oldNum = app.applicationIconBadgeNumber();
if (oldNum != 0) {
console.log('角标取值', oldNum);
// console.log("oldNum:"+oldNum);
var newNum = oldNum - 1;
//设置应用图标的数量
plus.runtime.setBadgeNumber(newNum);
//导入个推原生类
var GeTuiSdk = plus.ios.importClass('GeTuiSdk');
GeTuiSdk.setBadge(newNum);
}
网友评论