
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
react-native-widget-updater
Advanced tools
Get information about native widgets and trigger updates from React Native.
Update native home screen and lock screen widgets from JS.
Imagine you want to display an updated entry in your native widget. This package provides the ability to trigger updates.

yarn add react-native-widget-updater
or
npm install react-native-widget-updater
For all the function calls, a widget class name or kind is required. On iOS this will be the kind variable defined in the Widget struct, essentially the name of the widget:
struct WidgetUpdaterExampleWidget: Widget {
let kind: String = "WidgetUpdaterExampleWidget"
On Android it's the class name which extends the AppWidgetProvider class:
class ExampleAppWidget : AppWidgetProvider()
This needs to prefixed with a dot and becomes .ExampleAppWidget.
To update a widget from within react, call the updateAppWidgets function and pass the class names of your widgets.
import { updateAppWidgets } from 'react-native-widget-updater';
// Pass the classes of the app widget
const widgetClasses = ['.ExampleAppWidget'];
await updateAppWidges(widgetClasses);
To gather all in-use widgets from within react, call the getAppWidgetIds function and pass the class names of your widgets.
import { getAppWidgetIds } from 'react-native-widget-updater';
// Pass the classes of the app widget
const widgetClasses = ['.ExampleAppWidget'];
const result = await getAppWidgetIds(widgetClasses);
This will return a map of widget classes and the corresponding OS ids assigned, e.g. the .ExampleAppWidget currently has two instances on the home screen with the ids 18 and 19.
{
".ExampleAppWidget": [18, 19]
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Get information about native widgets and trigger updates from React Native.
We found that react-native-widget-updater 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.