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

@prescrire/push_notifications

v8.0.1

Published

A react component for cordova-powered hybrid application handling push notifications

Downloads

7

Readme

Installation

Make sure all peer dependencies related to cordova have been installed in config.xml

Debug

iOS: http://localhost:[PORT] Android: http://10.0.2.2:[PORT]

Android settings

Credentials to access FCM:

<resource-file src="google-services.json" target="app/google-services.json" />

Icons for push notification (pay attention the name of the icon should be 'ic_push.png') :

<resource-file src="res/android/push/icon_24x24.png" target="app/src/main/res/drawable-mdpi/ic_push.png" />
<resource-file src="res/android/push/icon_36x36.png" target="app/src/main/res/drawable-hdpi/ic_push.png" />
<resource-file src="res/android/push/icon_48x48.png" target="app/src/main/res/drawable-xhdpi/ic_push.png" />
<resource-file src="res/android/push/icon_72x72.png" target="app/src/main/res/drawable-xxhdpi/ic_push.png" />
<resource-file src="res/android/push/icon_96x96.png" target="app/src/main/res/drawable-xxxhdpi/ic_push.png" />

UPD: it is not required:

<edit-config file="AndroidManifest.xml" mode="add" target="/manifest/application">
  <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_push" />
</edit-config>

Set correct launch mode (this mode is required to correctly bring the app to foreground if the payload of the notification message is data):

<preference name="AndroidLaunchMode" value="singleTask" />.

Reference

Notification kinds

The app is in a certain state when it receives a notification. StateBackground if the app is in background, StateInactive if a user taps the notification from Notification Center, StateForeground if the app is in foreground. That is reflected by Push plugin in additionalData parameters: additionalData.coldstart and additionalData.foreground. coldstart stands for StateInactive. foreground stands for StateForeground and StateBackground.

Notification navigation

The app receives a notification only in two cases:

  • the app is in foreground
  • the app is in background and a user tapped a notification badge

The app doesn't receive a notification event if user opens the app without tapping the notification badge even if the notification center contains the notification.