The development of the npm module has been temporarily postponed.
The module allows refreshing and sharing of data between the main application and the widget.
See https://github.com/pafry7/widget-expo-example
- Clone repo
git clone [email protected]:pafry7/react-native-widget-sync.git
- Install dependencies
cd react-native-widget-sync
yarn
cd example
yarn
- Configure expo plugin in
/example
Add inapp.json
"ios": {
...
"entitlements": {
"appGroupIdentifier": <app group>
},
},
"plugins": {
[
"react-native-widget-sync",
{
"widgetName": <Your widget name>
"ios": {
"devTeamId": <Your apple team identifier>
"appGroupIdentifier": <app group>"
}
}
],
}
Run
npx expo prebuild
and then
npx expo run:[ios|android]
When you run expo prebuild for the first time, it generates a folder containing the source files for widgets and then copies them to both the ios and android directories. Remember to run prebuild each time you make changes to the widget's source files.