
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
capacitor4-notificationlistener
Advanced tools
Observe android notification being posted / removed using this NotificationListenerService wrapper for capacitor.
From repo : https://github.com/Alone2/capacitor-notificationlistener Observe android notification being posted / removed using this NotificationListenerService wrapper for capacitor.
npm i capacitor-notificationlistener
npx cap sync
Register this plugin using add(NotificationListenerPlugin.class) in your MainActivity.java like in the following example:
// ... code ...
import ch.asinz.capacitornotificationlistener.NotificationListenerPlugin;
// ... code ...
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Put it here!
add(NotificationListenerPlugin.class);
}});
// ... code ...
Add the following, contained in <application>, to your AndroidManifest.xml:
<service android:name="ch.asinz.capacitornotificationlistener.NotificationService"
android:label="@string/app_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
Import the plugin.
import { SystemNotification, SystemNotificationListener } from 'capacitor-notificationlistener';
const sn = new SystemNotificationListener();
Start listening for notifications.
sn.startListening();
Add a listener for new notifications or the removal of notifications.
Make sure you have called sn.startListening() to be able to receive notifications.
sn.addListener("notificationReceivedEvent", (info: SystemNotification) => {
// logic ...
});
sn.addListener("notificationRemovedEvent", (info: SystemNotification) => {
// logic ...
});
SystemNotification Interface. The anotomy of android notifications is explained here.
interface SystemNotification {
apptitle: string; // Title of a notifications' app
text: string; // Text of a notification
textlines: string[]; // Text of a multi-line notification
title: string; // Title of a notification
time: Date; // Time when a notification was received
package: string; // Package-name of a notifications' app
}
Check if the App is listening for notifications.
If it is not, even though sn.startListening() was called,
your app doesn't have sufficient permissions to observe notifications.
sn.isListening().then((value : boolean) => {
// logic ...
// example code:
// if not listening
if (!value)
// ask for Permission
sn.requestPermission()
});
Open settings so that the user can authorize your app.
sn.requestPermission();
Stop listening for notifications.
sn.stopListening();
FAQs
Observe android notification being posted / removed using this NotificationListenerService wrapper for capacitor.
The npm package capacitor4-notificationlistener receives a total of 0 weekly downloads. As such, capacitor4-notificationlistener popularity was classified as not popular.
We found that capacitor4-notificationlistener demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.