
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
react-native-local-notification-fabric
Advanced tools
React Native Local Notifications for iOS and Android
React Native Local Notification for Android and iOS
npm install react-native-local-notification-fabric
// override onActivityResult function in MainActivity.kt file
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
reactNativeHost.reactInstanceManager.packages.forEach {p: ReactPackage ->
if (p is LocalNotificationPackage) {
p.handleActivityResult(requestCode, resultCode, data)
}
}
}
//Config notification accent color and icon, alert dialog permission
Inside MainApplication.kt file, changes these line
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages.apply {
forEach { reactPackage ->
if (reactPackage is LocalNotificationPackage) {
reactPackage.initConfig(
NotificationConfig(
notificationIconResId = android.R.drawable.ic_lock_idle_charging,
notificationAccentColor = Color.RED,
locationPermissionDialogTitle = "Location permission required",
allowButtonText = "Allow"
)
)
}
}
}
}
Change AndroidManifest.xml
// add permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
// add receiver inside application tag
<application
.......
>
.......
<receiver android:name="com.localnotification.NotificationReceiver" android:exported="false"/>
</application>
import {
scheduleNotification,
scheduleGeofenceNotification,
cancelNotificationById,
} from 'react-native-local-notification-fabric';
// ...
// schedule notification at specific date
scheduleNotification('Test', 'body', '1113', '2023-07-18T09:49:00.000Z');
// schedule geofencing
scheduleGeofenceNotification(
'Test Geofence',
'On entering 266 Đội Cấn',
'1123',
21.03698,
105.813469,
500.0,
true,
false
);
//cancel
cancelNotification('1123');
Dialog access location:
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
React Native Local Notifications for iOS and Android
The npm package react-native-local-notification-fabric receives a total of 0 weekly downloads. As such, react-native-local-notification-fabric popularity was classified as not popular.
We found that react-native-local-notification-fabric 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.