Page MenuHomePhabricator

[Spike] Investigate custom app icons
Closed, ResolvedPublic1 Estimated Story PointsSpike

Description

This task involves engineering investigation into what it would take to create a custom app icon option for users to choose in Settings. See original product requirements at https://phabricator.wikimedia.org/T401446. If needed, this can be explored in a prototype branch, and ideally that work can be re-used when we create the final PR for T401446. Please write up any issues or complications discovered in this task.

Useful documentation: https://developer.apple.com/documentation/xcode/configuring_your_app_to_use_alternate_app_icons

Timebox: 1 day

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptAug 13 2025, 3:53 PM
Tsevener renamed this task from [Spike] Investigate what it would take to switch to a custom app icon to [Spike] Investigate custom app icons.Aug 13 2025, 3:53 PM
Tsevener set the point value for this task to 1.

FYI @GOlson-WMF, the original ask is to have this icon picker live under Reading Preferences - (see T401446 - "app theme section of settings"). This screen is AppearanceSettingsViewController, and is a Swift UIKit view controller.

Spike Findings:

  • Yes! We will need all of the assets and for them to be properly named (i.e SpecialAppicon60x60 or whatever we end up naming it, but in order for this to be parsed it has to be VERY specific and we'll need to include it in the info.plist
  • info.plist -> (Wikipedia -> Code -> Application -> Supporting Files) will need this code snippet below (updated to include all icons, and proper names)
    <key>CFBundleAlternateIcons</key>
    <dict>
        <key>BackupIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>BackupAppIcon60x60</string>
            </array>
            <key>UIPrerenderedIcon</key>
            <false/>
        </dict>
    </dict>
</dict>
  • We can easily add the section to AppearanceSettingsViewController (we'll have to have a flag for users who get the option or not, which I did not include in the spike)
  • We have to make sure to have it toggle back by sending nil
private func toggleIcon(newValue: Bool) {
    if newValue {
        // Set new icon
        UIApplication.shared.setAlternateIconName("BackupIcon") { (error) in
            if let error = error {
                print("Failed request to update the app’s icon: \(error)")
            }
        }
    } else {
        // Set default icon
        UIApplication.shared.setAlternateIconName(nil) { (error) in
            if let error = error {
                print("Failed request to update the app’s icon: \(error)")
            }
        }
    }
}

Check out https://github.com/wikimedia/wikipedia-ios/pull/5389
https://www.hackingwithswift.com/example-code/uikit/how-to-change-your-app-icon-dynamically-with-setalternateiconname

App icon updates immediately, no need for restart of app