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

com.commontime.cordova.notification

v1.0.11

Published

Commontime cordova notification plugin.

Downloads

20

Readme

Cordova Notification Plugin

A modified version of Katzer local-notification plugin found at https://github.com/katzer/cordova-common-registerusernotificationsettings/blob/master/plugin.xml. This adds in the ability to include actions for both iOS and Android and hook into the user's response in JavaScript.

The essential purpose of local notifications is to enable an application to inform its users that it has something for them — for example, a message or an upcoming appointment — when the application isn’t running in the foreground. They are scheduled by an application and delivered on the same device.

How they appear to the user

Users see notifications in the following ways:

  • Displaying an alert or banner
  • Badging the app’s icon
  • Playing a sound

Examples of Notification Usage

Local notifications are ideally suited for applications with time-based behaviors, such as calendar and to-do list applications. Applications that run in the background for the limited period allowed by iOS might also find local notifications useful. For example, applications that depend on servers for messages or data can poll their servers for incoming items while running in the background; if a message is ready to view or an update is ready to download, they can then present a local notification immediately to inform their users.

Supported Platforms

The plugin supports the following platforms:

  • iOS (including iOS8)
  • Android (SDK >=7)
  • Windows 8.1
  • Windows Phone 8.1

Sample

The sample demonstrates how to schedule a local notification which repeats every week. The listener will be called when the user has clicked on the local notification.

cordova.plugins.notification.schedule({
    id: 1,
    title: "Production Jour fixe",
    text: "Duration 1h",
    firstAt: monday_9_am,
    every: "week",
    sound: "file://sounds/reminder.mp3",
    icon: "http://icons.com/?cal_id=1",
    data: { meetingId:"123#fg8" }
});

cordova.plugins.notification.on("interactedWith", function (notification) {
    joinMeeting(notification.data.meetingId);
});

Below shows how to set actions on notifications and the function to listener for a reponse.

cordova.plugins.notification.schedule({
	id: 1,
	title: "Scheduled notification with delay",
	text: "Message",
	at: _3_sec_from_now,
	sound: null,
	category: {
		identifier: "AWSOME_CATEGORY",
		actions: [{
			title: "Awsome Action",
			identifier: "AWSOME_ACTION", 
			textInput: true/false
		}]
	}
});

cordova.plugins.notification.on("interactedWith", function(notification) {
    var identifier = notification.actionResponseIdentifier;
    var responseText = notification.actionResponse; // If textInput is not set to true this will not exist
}

As well as the local notifications there is also the ability to register and listen for push notifications. The code that has been merged into this plugin to enable this functionality is from the PushPlugin project at https://github.com/phonegap-build/PushPlugin.