Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
expo-notifee-remote-plugin
Advanced tools
Plugin to create a Notification Service extension in order to let Notifee mutate remote notifications
expo-notifee-remote-plugin
expo-notifee-remote-plugin
is an Expo plugin that configures a NotificationServiceExtension to use Notifee for remote notifications📖 Please visit the
Notifee's Docs: Remote Notification Support
to see what this plugin does behind the scenes
yarn add expo-notifee-remote-plugin
npm install --save expo-notifee-remote-plugin
plugins
in your app.json
file:{
"expo": {
"plugins": [
[
"expo-notifee-remote-plugin",
{
"developmentTeam": "MYDEVTEAMID"
}
]
]
}
}
npx expo prebuild -p ios
yarn ios
If you use app.config.ts
for example:
import { ExpoConfig } from 'expo/config';
import { TExpoNotifeeRemote } from 'expo-notifee-remote-plugin';
const notifeeOptions: TExpoNotifeeRemote = {
/**
* Apple App Group if applicable.
* @link https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups
*/
appGroup?: string;
/** Custom target name of the NotificationServiceExtension
* @default NotifeeNotificationService
*/
appTarget?: string;
developmentTeam: string;
/**
* An array containing the sound file names (including file extensions)
* @example soundFiles: ['dm.aiff']
* */
soundFiles?: string[];
/** Path of the folder that contains the sound. Relative to the app.config.js file.
* @example soundFilesPath: 'assets/audio'
*/
soundFilesPath?: string;
};
export const plugins: ExpoConfig['plugins'] = [
'expo-localization',
['expo-screen-orientation', { initialOrientation: 'PORTRAIT_UP' }],
'@react-native-firebase/app',
['expo-notifee-remote-plugin', notifeeOptions],
];
Example with Firebase Node SDK:
import type {Notification} from '@notifee/react-native/src/types/Notification';
import {AndroidImportance} from '@notifee/react-native/src/types/NotificationAndroid';
import {MulticastMessage} from 'firebase-admin/lib/messaging/messaging-api';
import admin from '../src/firebase-admin';
/**
* @link https://notifee.app/react-native/reference/notification
*/
const notifeeOptions: Notification = {
title: 'Title',
subtitle: 'Subtitle',
body: 'Main body content of the notification',
android: {
channelId: 'default',
importance: AndroidImportance.HIGH,
lightUpScreen: true,
pressAction: {
id: 'default',
},
sound: 'default',
},
ios: {
sound: 'default',
// Adding `foregroundPresentationOptions` controls how to
// behave when app is UP AND RUNNING, not terminated,
// AND not in background!
foregroundPresentationOptions: {
badge: true,
banner: true,
list: true,
sound: true,
},
},
};
/**
* @description Firebase Message
* @link https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.basemessage.md#basemessage_interface
*/
const message: MulticastMessage = {
// ✅ We can continue using local/data-only notification for Android
// 👍 while triggering iOS remote notifications from `apns`
data: {notifee_options: JSON.stringify(notifeeOptions)},
tokens: [],
android: {
priority: 'high', // Needed to trigger data-only notifications
},
apns: {
payload: {
notifee_options: notifeeOptions,
aps: {
alert: {
// 🚧 This is needed to trigger an alert/remote notification only for iOS
// 👍 but Android will continue using data-only notifications
title: 'ANY_DUMMY_STRING',
},
mutableContent: true,
},
},
},
};
try {
admin.messaging().sendEachForMulticast(message)
res.status(200).end();
} catch (e) {
res.status(400).end();
}
This plugin handles moving the necessary NotifeeNSE files into their respective iOS directories.
group.<identifier>
if applicable📃 This project is released under the MIT License.
💻 By contributing, you agree that your contributions will be licensed under its MIT License.
Adapted from:
https://github.com/OneSignal/onesignal-expo-plugin/blob/main/onesignal/withOneSignalIos.ts
https://github.com/bluesky-social/social-app/tree/main/plugins/notificationsExtension
https://github.com/andrew-levy/react-native-safari-extension
FAQs
Plugin to create a Notification Service extension in order to let Notifee mutate remote notifications
The npm package expo-notifee-remote-plugin receives a total of 0 weekly downloads. As such, expo-notifee-remote-plugin popularity was classified as not popular.
We found that expo-notifee-remote-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.