UNI-APP 桌面LOGO角标设置(ios)
使用uni-push后在ios上桌面图标显示角标, 并且不消失
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); }