CapacitorJS 2024: is there a way to add widgets for apps?

is there a way to add widgets for apps, in a cross-platform manner? Or at least for just ios/ just android?

What would be the procedure here? Could I hardcode some native code in the native project version which asks at a specific time to add a widget?

Or do i need to build a plugin to achieve this?

Maybe someone can tell me how hard writing a plugin is, or even just the native code. I am wondering

SOLUTION:
just use native code. It’s not a lot of work!

You’ll need to create the widget itself in native code but you’ll also likely need to use Capacitor to set the data used by the widget as well as to trigger a widget refresh anytime you update it.

I used this plugin for iOS and it worked nicely. For Android I had to use custom code and it was more complicated, but that’s partially because I used an Android ListView in the widget.

There is also this Capacitor plugin that supports iOS and Android but I haven’t tried it.

1 Like