| 客户端 | Android | iOS |
|---|---|---|
| 支持说明 | 仅支持华为 | 支持 |
import { PushNotification } from "@yl/super-jssdk";
PushNotification.setPushBadgeNumber(optional);
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| optional | Object | 是 | 必填参数 |
optional
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| count | number | 是 | 角标数量 |
| 参数 | 类型 | 作用 |
|---|---|---|
| resolve | Function | 设置角标成功回调 |
| reject(err) | Function | 设置角标失败回调,err为详细错误信息,是一个json对象,例如:{"errCode":-1,"errMsg":"出错啦"} |
PushNotification.setPushBadgeNumber({count: 2})
.then(res => {
console.log('success', res);
})
.catch(err => {
console.log('fail', res);
})