Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

nilavanraj/react-native-custom-timer-notification

Repository files navigation

react-native-custom-timer-notification

Custom timer notification for React Native Android 🔔 ezgif com-gif-maker

Installation

npm install react-native-custom-timer-notification

AndroidManifest

      <receiver android:name="com.reactnativecustomtimernotification.NotificationEventReceiver" />
      <receiver android:name="com.reactnativecustomtimernotification.OnClickBroadcastReceiver" />
      <!--
      if foreground service used add this line
      -->
      <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
      <service android:name="com.reactnativecustomtimernotification.ForegroundService"/>

Usage

payload sent will be received when click or canceled
title Title of the notification
body Body of the notification
id unique number
sec Time in seconds

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

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

const result = await TimerNotification({
      payload: JSON.stringify("notificationOpen?.data"), 
      title: "My notification",
      body:"Much longer text that cannot fit one line... ",
      id: 1,
      sec:60,
      remove:false, // optional 
      foreground:false,
     })

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Morty Proxy This is a proxified and sanitized view of the page, visit original site.