Dec 19, 2022

Give Your React Native App a dynamic App Icon

Setting up a dynamic app icon for react native application using react-native-change-icon

Author

Sakshya AroraTech Lead - I
Give Your React Native App a dynamic App Icon

Today, many apps change their app icons programmatically from within the app. This adds to their interactive UI and helps enhance user experience.

Interactive UI

In this blog, we'll try to change the app icon on the fly easily using this awesome npm package - react-native-change-icon.

Demo

Mobile app UI demo

Installing the Package

You don't need to worry about the native code for changing the app icon as react-native-change-icon handles all of that for you.

Run this command in your CLI inside your project directory:

npm i react-native-change-icon

Or

yarn add react-native-change-icon

Creating App Icons for Your App

Go to appicon.co to generate your app icons by uploading a 1024x1024 resolution image.

Creating app icon for your app

Just like above, you can create your other app icons as well.

Note: Icon names must contain only lowercase a-z.

Setting up The Dynamic App Icon

For Android

1. Adding The App Icons

As you now have your app icons, Go to android ->app -> src -> main -> res -> mipmap-* directories: and add all the icons you need.

Once you are done adding the icons, your folder will look similar to this.

Adding app icons in Android

2. Updating AndroidManifest.xml file

For each of your app icon, you'll be adding an activity-alias like this.

<activity-alias
			android:name="com.dynamicappicon.MainActivitylogored"
			android:enabled="true"
			android:exported="true"
			android:icon="@mipmap/logored"
			android:targetActivity=".MainActivity">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity-alias>

name in this should be the package + MainActivity + {icon name}.

In the end, your AndroidManifest.xml file will look like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dynamicappicon">

    <uses-permission android:name="android.permission.INTERNET" />

	<application
		android:name=".MainApplication"
		android:label="@string/app_name"
		android:icon="@mipmap/logored"
		android:allowBackup="false"
		android:theme="@style/AppTheme">
		<activity
    android:name=".MainActivity" />
		<activity-alias
			android:name="com.dynamicappicon.MainActivitylogored"
			android:enabled="true"
			android:exported="true"
			android:icon="@mipmap/logored"
			android:targetActivity=".MainActivity">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity-alias>
		<activity-alias
			android:name="com.dynamicappicon.MainActivitylogoblack"
			android:enabled="false"
			android:exported="true"
			android:icon="@mipmap/logoblack"
			android:targetActivity=".MainActivity">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity-alias>
	</application>
</manifest>

You can create more <activity-alias> tags to make more alternate icons.

For iOS

  1. First, go to the ios/ folder and do pod install.
  2. Open your app in Xcode and add an AppIcons group to your app.
  3. Add all your 120x120 resolution image as image@2x.png and 180x180 resolution image as image@3x.png.
  4. Open the Info.plist file.
  5. Add Icon files (iOS 5) to the Information Property List.
  6. Add CFBundleAlternateIcons as a dictionary to the Icon files (iOS 5) as it is used for the alternative icons.
  7. Add dictionaries under CFBundleAlternateIcons named as your icon names in the AppIcons group.
  8. For each dictionary, these two properties UIPrerenderedIcon and CFBundleIconFiles need to be configured.
  9. Set the type of UIPrerenderedIcon to String and its value to NO.
  10. Set the type of CFBundleIconFiles to Arrayand set its first key,Item 0toString` with the value of the icon name.
  11. set the default icon name in Primary Icon and Newsstand Icon -> Icon files -> Item 0.

Here's how:

Adding dynamic icons for iOS

In the end, your Info.plist icon changes will look like this:

Dynamic app icons iOS results

How To Use This In Your App?

Use the following code:

import { changeIcon, getIcon } from 'react-native-change-icon';

changeIcon('iconname');        // pass the icon name to change the icon 

getIcon();                     // to get the currently active icon

Conclusion

We discussed how to change app icons dynamically in react-native without worrying about native code implementation.

Adding dynamic app icons is easy to conclude with

Feel free to check out the working example.

I hope this article helped you to learn something new! Please share your thoughts in the comment box.

Happy Learning!! 🙂

Subscribe to Our Newsletter

RELATED ARTICLES

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.
Why Legacy Systems Block Real-Time AI Decision-Making
Business

Aug 4, 2026

Why Legacy Systems Block Real-Time AI Decision-Making
Learn how legacy systems limit real-time AI decision-making and what businesses can do to build an AI-ready infrastructure.
What Makes an AI Product Enterprise-Ready? A Business Leader’s Perspective
Business

Aug 4, 2026

What Makes an AI Product Enterprise-Ready? A Business Leader’s Perspective
Most AI pilots never make it to production. Here are the five questions business leaders should ask before approving, buying, or scaling an AI product.
Building AI-Powered Banking CRM Platforms Without Replacing Core Banking Systems
Business

Jul 31, 2026

Building AI-Powered Banking CRM Platforms Without Replacing Core Banking Systems
Banks can modernize CRM with AI without replacing their core banking systems. This guide covers the architecture, use cases, governance, and roadmap to do it.
AI in Fintech: Everyone's Talking, Few are Shipping
Business

Jul 30, 2026

AI in Fintech: Everyone's Talking, Few are Shipping
This blog covers the key engineering, governance, and compliance principles required to build production-ready AI systems for financial services.
ERP and MES Integration for U.S. Pharma Manufacturers: A Roadmap to Achieve Zero-Error Production and End-to-End Traceability
Business

Jul 27, 2026

ERP and MES Integration for U.S. Pharma Manufacturers: A Roadmap to Achieve Zero-Error Production and End-to-End Traceability
A strategic roadmap for U.S. pharma leaders integrating ERP and MES to reduce production errors, accelerate batch release, strengthen compliance readiness, and enable end-to-end traceability across manufacturing sites.
How to Build Medical Device Software with AI: Compliance, Architecture, and Development Process
Business

Jul 24, 2026

How to Build Medical Device Software with AI: Compliance, Architecture, and Development Process
A guide for engineering leaders on building compliant, production-ready AI medical device software, from architecture to FDA clearance.

The Right Conversation Can Save You Six Months.

Whether you’re navigating AI adoption, modernizing legacy systems, or scaling a product - we start by listening. No pitch deck. No template. A real conversation.