Expo Alternate App Icons is a library that allows you to easily switch between different app icons in your Expo project.
Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
❌ | ❌ | ✅ | ✅ | ❌ |
Customizing app icons can be a valuable way to provide users with a personalized experience for your app. This library simplifies the process of implementing alternate app icons in your Expo project.
To get started, install the library using Expo CLI:
expo install expo-alternate-app-icons
This package contains an Expo Plugin that copies your alternative icons to the Xcode project.
- Add
expo-alternate-app-icons
to the plugins array inside your app.json. - The second item in the array accepts an array with paths to your alternate icons.
// app.json
{
// ...
plugins: [
// ...
[
'expo-alternate-app-icons', // add "expo-alternate-app-icons" to the plugins array
['./assets/icon-a.png', './assets/icon-b.png', './assets/icon-c.png'], // array with paths to the icons
],
],
}
Your icons should follow the same format as your default app icon.
- Use a .png file.
- Square format with resolution 1024x1024 px.
- Without transparency layer.
A boolean value indicating whether the current device supports alternate app icons.
const supportsAlternateIcons: boolean;
To set app icon to icon-a.png, use setAlternateAppIcon("icon-a")
. This function takes exact icon name without suffix.
To reset the app icon to the default pass null
like setAlternateAppIcon(null)
.
function setAlternateAppIcon(name: string | null): Promise<string | null>;
Retrieves the name of the currently active app icon.
function getAppIconName(): string | null;
Reset app icon to the default one.
This is just a shortcut for
setAlternateAppIcon(null)
.
function resetAppIcon(): Promise<void>;