How would you add an iOS 14 widget to a Defold game?

To create a widget for an iOS 14 app, you need to create a Widget Extension that you create with SwiftUI. In Apple’s demos, they show you how to add an extension to an existing iOS app through Xcode.

As far as I know, this wouldn’t be possible to do when making a bundle using Defold, since you build directly to an .app file and skip Xcode entirely. Is there something I’m missing that I can use to add a widget extension to a Defold game, or should this be a feature request of some kind?

How are widget extensions used? I’m not familiar with them. What is their purpose?

Basically widgets are used to show data from an app onto the home screen, like this:

This would be useful in idle games or other games with timers since you could display that timer on the home screen instead of needing to open the app to check or rely on a push notification. Or you could just use it to display data of some kind, like what level your character is in an RPG.

Ah, I see. I have no idea how you would do that. We can spend time researching it if it becomes a popular request from our community.

2 Likes