报错:Value for nitificationId cannot be cast from String to Double
消息过来
重现步骤
监听了addNotificationListener方法
this.notificationListener = result => {
console.log('notificationListener:' + JSON.stringify(result));
console.log('notificationListener:', result);
if (
result &&
result.extras &&
result.notificationEventType === 'notificationArrived'
) {
let extras = result.extras;
switch (extras.type) {
case 'sensitive':
console.log('授权通知', extras);
this.setState(
{
authInfo: {
...extras,
isVisible_out: true,
},
},
() => {
// JPush.clearAllNotifications();
console.log('JPush.clearNotificationById', result.messageID);
//报错:Value for nitificationId cannot be cast from String to Double
JPush.clearNotificationById({notificationId: result.messageID});
},
);
break;
default:
break;
}
}
};
JPush.addNotificationListener(this.notificationListener);
Debug logs
包括 Android 或 iOS 的日志:
//报错:Value for nitificationId cannot be cast from String to Double
JPush.clearNotificationById({notificationId: result.messageID});
你的运行环境
期望效果
处理消息完毕之后,把通知栏目对应的消息去掉
实际效果
报错:Value for nitificationId cannot be cast from String to Double
消息过来
重现步骤
Debug logs
包括 Android 或 iOS 的日志: //报错:Value for nitificationId cannot be cast from String to Double JPush.clearNotificationById({notificationId: result.messageID});