Skip to content

Fix / Support Icon Composer app icons - #7

Open
levochkaa wants to merge 1 commit into
EncoreKit:mainfrom
artworkout-team:fix/icon-composer-app-icon
Open

Fix / Support Icon Composer app icons#7
levochkaa wants to merge 1 commit into
EncoreKit:mainfrom
artworkout-team:fix/icon-composer-app-icon

Conversation

@levochkaa

Copy link
Copy Markdown

Context

Apps built with Xcode's Icon Composer may expose a CFBundleIconName that points to an icon stack rather than a bitmap asset. Calling UIImage(named:) with that name can raise the Objective-C exception Need an imageRef instead of safely returning nil.

As a result, rendering the SDUI appIcon element could crash the host app while Encore was resolving the publisher icon.

Changes

  • Resolve the host icon from raster filenames in CFBundleIconFiles first.
  • Inspect the standard CFBundleIcons metadata emitted for iPhone and the iPad-specific CFBundleIcons~ipad override.
  • Match the declared icon filenames against bundled PNG resources and select the image with the largest pixel area.
  • Use CFBundleIconName only as a legacy fallback when no file metadata is available.
  • Never pass a potentially unresolved Icon Composer stack name to UIImage(named:) when CFBundleIconFiles is present.

Compatibility

  • Icon Composer .icon bundles.
  • Standard AppIcon.appiconset asset catalogs.
  • Legacy named-image bundles without CFBundleIconFiles.
  • No public SDK API changes.

Co-authored-by: Codex <noreply@openai.com>
@mryan-encorekit

mryan-encorekit commented Aug 28, 2026

Copy link
Copy Markdown

Thanks for the find, @levochkaa. We applied your diff to our current source: it lands clean and builds clean on our side.

We are taking the fix, with two changes. We read the declared raster names directly rather than scanning the bundle and decoding every PNG to compare pixel area, and we prefer the base CFBundleIcons over the iPad override so an iPhone cannot pick the iPad raster. Ships in the next release and we will follow up here with the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants