iOS Widget Extension on EAS Build

Is it possible to create an iOS Widget Extension in EAS Build’s Managed Workflow?

I know that EAS Build does not yet support Widget Extension. However, I think it is technically possible because we can update the contents of the ios/ folder with the Config Plugin during Prebuild.

However, adding the Widget Extension on XCode also updates the project.pbxproj file, so we need to reflect the differences as well, but it is tough to update the pbxproj file automatically in Config Plugin. Is there a good way to achieve this?

If it is difficult to do so, I would like to eject.

you can check GitHub - OneSignal/onesignal-expo-plugin: The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
they are adding notifications service extensions in that plugin

support for generating credentials was added recently (no docs yet other than PR description [eas-cli] generate credentilas for iOS app extensions by wkozyra95 · Pull Request #1039 · expo/eas-cli · GitHub) (or you could use credentilas.json)
expo does not support entitlements for multiple targets, so your extension would get the same one as the main target

3 Likes

Thanks for your information!

I am surprised that such an implementation example already exists. I will try to implement it with reference to this one.

1 Like

Please let us know how it goes, I’m also needing to write a widget for iOS and Android soon.

I have successfully created widgets in Managed Workflow and released them on production! @wkozyra Thanks for your advice :+1:

The development process was to create a Widget in Android and iOS as usual in the prebuilt (ejected) state and then create Config Plugins to make the same file structure. The process may be similar to provisioning with Ansible, etc.

For Android, it was relatively easy because all I had to do was prepare files. However, for iOS, it wasn’t easy because the “pbxproj” file needed to be updated (onesignal-expo-plugin was very helpful). The more files (swift files, fonts, localization files, etc.) used for widgets, the more difficult it becomes. It is hard but not impossible if the contents of the pbxproj file are steadily modified to be the same.

I created a minimal example repository for your reference.

It contains only minimum features. It will be more complicated when you create it. You might need Shared Groups, the ability to reflect app updates, etc. But who wants to create widget might refer.

Thanks,

2 Likes