npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-custom-timer-notification

v0.9.0

Published

custom timer notification

Downloads

43

Readme

react-native-custom-timer-notification

Custom timer notification for React Native Android 🔔 Now version 0.8 Supports full size custom notifications

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

Timer notification

Only Timer notifiction with default Title and body


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

| Property | Description | | --- | --- | | payload | sent data 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|

Example


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

Full custom notifiction with custom image, text and cronometer.


import { CustomNotification, TYPES, FB_TYPE } from "react-native-custom-timer-notification";

| Property | Description | | --- | --- | | eventData | sent data will be received when click or canceled | | title |Title of the notification| | body |Body of the notification | | id |unique number| | View |View that needs to be added (Array)|

| Property | Description | | --- | --- | | name | text that needs to be displayed | | size |Size of text| | type |Type of view (Text,Image, Cronometer) | | bold |Font (NORMAL,BOLD,ITALIC,BOLD_ITALIC)| | uri |Image in base64| | PaddingLeft |Left Padding| | PaddingTop |PaddingTop| | PaddingRight |PaddingRight| | PaddingBottom |PaddingBottom| | color |Text color| | ZeroTime |Time at which zero comes|

Example


    CustomNotification(
      {
        eventData: JSON.stringify('notificationOpen?.data'),
        title: 'notificationOpen.data.title',
        body: ' notificationOpen.data.body',
        id: 1,

        View: [
          {
            name: 'Limited Sales',
            size: 20,
            type: TYPES.Text,
            bold: FB_TYPE.BOLD_ITALIC,
            PaddingLeft: 10,
            PaddingTop: 50,
            PaddingRight: 0,
            PaddingBottom: 0,
            setViewVisibility: false,
            color: '#ed1a45',
          },
          {
            uri: image,
            type: TYPES.Image,
            PaddingLeft: 0,
            PaddingTop: 0,
            PaddingRight: 0,
            PaddingBottom: 0,
          },
          {
            name: 'Buy now',
            size: 30,
            type: TYPES.Text,
            bold: FB_TYPE.BOLD_ITALIC,
            PaddingLeft: 10,
            PaddingTop: 100,
            PaddingRight: 0,
            PaddingBottom: 0,
            setViewVisibility: false,
            color: '#fbd335',
          },
          {
            type: TYPES.Cronometer,
            size: 30,
            ZeroTime: new Date(Date.now() + 20000),
            PaddingLeft: 800,
            color: '#0000FF',
            PaddingTop: 0,
            PaddingRight: 0,
            PaddingBottom: 0,
          },
        ],
      },
      (e: any) => {
        console.log(e);
      }
    );
    

Remove Notifications

import { RemoveTimer } from "react-native-custom-timer-notification";

RemoveTimer(1);

onclick and cancel listner

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

onEvent(event=>{
console.log(event)
});

Contributing

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

License

MIT