You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interestingly, the generated JSON clearly contains the correct value (23 unread messages), which suggests the widget component is being rendered correctly during serialization. However, the Android widget runtime appears unable to parse the generated node format and keeps the widget in the loading state.
Am I missing any additional configuration required for dynamic widgets, or could this be a compatibility issue between the generated dynamic widget format (v: 1, variants, shared style references) and the Android runtime parser?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey @V3RON,
I was able to successfully create a static widget that acts as an app-launch shortcut.
Now I'm trying to create a widget that displays an unread message count and update it from the application using:
await updateAndroidWidget('MessageWidget', [
{
size: { width: 300, height: 200 },
content: ,
},
]);
I can confirm that the prop is being passed correctly, as the android native logs show:
'typeof unreadCount:', 'number'
'unreadCount:', 23
However, the home screen widget never renders the updated content and stays in the loading state.
My Android widget configuration is in volta.config.ts created for bare RN app:
{
id: 'MessageWidget',
displayName: 'MessageWidget',
description: 'Unread message count and quick access to conversations',
targetCellWidth: 2,
targetCellHeight: 2,
minCellWidth: 2,
minCellHeight: 2,
resizeMode: 'horizontal|vertical',
widgetCategory: 'home_screen|keyguard',
previewLayout: './assets/widgets/message_widget_preview.xml',
previewImage: './assets/voltra-android/test_virtual.png',
initialStatePath: './widgets/android-messagewidget-initial.tsx',
// entry: './widgets/messageWidget.android.tsx',
}
If I enable the entry property:
entry: './widgets/messageWidget.android.tsx',
Voltra generates a different structure in voltra_initial_states.json, and the widget fails with the following error:
Failed to parse node for widgetId=MessageWidget:
Unsupported VoltraNode shape:
{
"v": 1,
"s": [...],
"variants": {
"300x200": {
...
"c": "23 unread messages"
...
}
}
}
Interestingly, the generated JSON clearly contains the correct value (23 unread messages), which suggests the widget component is being rendered correctly during serialization. However, the Android widget runtime appears unable to parse the generated node format and keeps the widget in the loading state.
Am I missing any additional configuration required for dynamic widgets, or could this be a compatibility issue between the generated dynamic widget format (v: 1, variants, shared style references) and the Android runtime parser?
Any guidance would be appreciated. Thanks! 🙏
Beta Was this translation helpful? Give feedback.
All reactions