reactjs NPMReact-本机-自定义-计时器-通知

lmyy7pcs  于 2023-01-02  发布在  React
关注(0)|答案(1)|浏览(98)

你好朋友,我有疑问,我想知道你们是否可以帮助我。我在做一个项目,在React原生,我需要推通知包含一个计时器/倒计时,他们可以暂停/开始任务和倒计时。这对我来说是一个挑战。我想做的应用程序番茄的通知,它通过它们暂停任务,并警告你还有多少时间完成一项任务。我在互联网上什么也没找到我只是在NPM网站上找到了依赖性React-Native-Custom-Timer-Notification,如果你知道任何其他可以做到这一点的依赖性,请让我过去

Usage
payload sent will be received when click or canceled
title Title of the notification
body Body of the notification
id unique number
date Time at which zero comes

import { TimerNotification, onEvent } from "react-native-custom-timer-notification";

// ...

// onclick and cancel listner
onEvent(event=>{
console.log(event)
});

// Remove timer 
RemoveTimer(160211114);

//Trigger notification
  TimerNotification({
      payload: JSON.stringify('notificationOpen?.data'),
      title: 'My notification',
      body: 'Much longer text that cannot fit one line... ',
      id: 160211114,
      remove: false, // optional
      foreground: false,
      date: new Date(Date.now() + 20000),
      isCountDown: true, // false for positive timer 
      setCustomContentView:true // optional
    });
0tdrvxhp

0tdrvxhp1#

现在react-native-custom-timer-notification v0.8支持全面的自定义通知。我认为这可能会帮助你在这种情况下。https://www.npmjs.com/package/react-native-custom-timer-notification

相关问题