停止计划的推送通知反应本机推送通知
Stopping Scheduled Push Notification In react native push notifications
我想在按下按钮时停止发送预定的通知。
就像我想取消安排/停止/取消之前安排的推送通知,然后进一步的通知不应该来
使用库
https://www.npmjs.com/package/react-native-push-notification
我的目标不是取消来自通知栏或中心的通知。但要停止此预定通知
PushNotification.localNotificationSchedule({
channelId: 'channel name',
date: new Date(Date.now()),
title: 'title',
message: 'message',
repeatType: 'day',
});
我没有验证下面的代码,但应该按照插件 github 问题页面
中的建议工作
const id = 1;
PushNotification.localNotificationSchedule({
id: `${id}`
message: 'My Scheduled Notification Message',
date: new Date(Date.now() + (5 * 1000))
})
PushNotification.cancelLocalNotifications({ id: `${id}` })
我想在按下按钮时停止发送预定的通知。 就像我想取消安排/停止/取消之前安排的推送通知,然后进一步的通知不应该来 使用库 https://www.npmjs.com/package/react-native-push-notification 我的目标不是取消来自通知栏或中心的通知。但要停止此预定通知
PushNotification.localNotificationSchedule({
channelId: 'channel name',
date: new Date(Date.now()),
title: 'title',
message: 'message',
repeatType: 'day',
});
我没有验证下面的代码,但应该按照插件 github 问题页面
中的建议工作const id = 1;
PushNotification.localNotificationSchedule({
id: `${id}`
message: 'My Scheduled Notification Message',
date: new Date(Date.now() + (5 * 1000))
})
PushNotification.cancelLocalNotifications({ id: `${id}` })