简体   繁体   English

如何在React-Native中使用Time进行通知?

[英]How to make notifications using Time in React-Native?

I have simple app and I want to make the notification by the time for example : 我有一个简单的应用,例如,我想按时间发出通知:

I want You reminder me after : (The user choose) : [ 15 , 30 , 45 , 60 ] Days 我希望您在以下时间提醒我:(用户选择):[15,30,45,60]天

if he choosed 30 days then after 30 days he get a notification 如果他选择了30天,则在30天后收到通知

I've had good results syncing with the native calendar to push out notifications like like you describe using react-native-calendar-events. 与本机日历同步以发出类似您使用react-native-calendar-events描述的通知时,我取得了不错的结果 Once installed it is simple. 一旦安装,它很简单。 You'd create an event every 30, 60 days. 您将每30、60天创建一次活动。 The 'alarm' calls the native notification system so it does most of the work for you. “警报”调用本机通知系统,因此它将为您完成大部分工作。

   RNCalendarEvents.saveEvent('Move Car', {
    startDate: s,
    endDate: e,
    location: l,
    alarms: [{
      date: a
}]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM