The Easiest Way to Create and Manage App Icons for React Native on IOS & Android

To create app icon you need:

PNG icon for IOS and Android (I highly recommend using an icon with a size of at least 1024×1024 pixels)
You can also create Adaptive Icon for Android, which can display a variety of shapes across different device models …


This content originally appeared on DEV Community and was authored by ?#@*&%!

To create app icon you need:

  • PNG icon for IOS and Android (I highly recommend using an icon with a size of at least 1024x1024 pixels)
  • You can also create Adaptive Icon for Android, which can display a variety of shapes across different device models (Learn More). To create it you need a foreground image and a background color or image. There is also a good article on how to design such icons.

In this guide we’re going to use the following assets, which can be found in GitHub repository:

screenshot of assets to create app icon

First you need to install ⭐ ️icon-set-creator:

$ npm install -g icon-set-creator
# OR
$ yarn global add icon-set-creator

After installation, you will have access to the iconset binary in your command line. You can verify that it is properly installed by simply running iconset, which should present you with a help message listing all available commands.

Now you can create config file for icon-set-creator. Create iconset.config.js file in root of your app (where package.json is located) and set options for our assets:

  • imagePath — The location of the icon image file which you want to use as the app launcher icon. e.g. ./assets/icon.png
  • android/ios (optional): true — Override the default existing Flutter launcher icon for the platform specified, false — ignore making launcher icons for this platform, icon_name — this will generate a new launcher icons for the platform with the name you specify, without removing the old default existing Flutter launcher icon.
  • imagePathAndroid — The location of the icon image file specific for Android platform (optional — if not defined then the imagePath is used)
  • imagePathIos — The location of the icon image file specific for iOS platform (optional — if not defined then the imagePath is used)

The next two attributes are only used when generating Android launcher icon:

  • adaptiveIconBackground — The color (E.g. "#ffffff") or image asset (E.g. "assets/images/dark-background.png") which will be used to fill out the background of the adaptive icon
  • adaptiveIconForeground — The image asset which will be used for the icon foreground of the adaptive icon

In our example we will use one icon for both platforms and also an adaptive icon for android. This is how the our config file will look:

/*iconset.config.js*/
module.exports = {
  imagePath: './assets/app-icon/icon.png',

  adaptiveIconBackground: './assets/app-icon/background.png',
  adaptiveIconForeground: './assets/app-icon/foreground.png'
};

? Enter the command below and you’re done!

$ iconset create

If you want, you can add the package in the dev dependencies and the scripts to the package.json:

{
  "scripts": {
    "create-appicon": "iconset create"
  },
  "devDependencies": {
    "icon-set-creator": "latest"
  }
}

Next time you can just enter the npm run create-appicon command.

? Thanks for reading! If you like what I do, you can follow me on GitHub


This content originally appeared on DEV Community and was authored by ?#@*&%!


Print Share Comment Cite Upload Translate Updates
APA

?#@*&%! | Sciencx (2021-08-15T10:42:23+00:00) The Easiest Way to Create and Manage App Icons for React Native on IOS & Android. Retrieved from https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/

MLA
" » The Easiest Way to Create and Manage App Icons for React Native on IOS & Android." ?#@*&%! | Sciencx - Sunday August 15, 2021, https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/
HARVARD
?#@*&%! | Sciencx Sunday August 15, 2021 » The Easiest Way to Create and Manage App Icons for React Native on IOS & Android., viewed ,<https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/>
VANCOUVER
?#@*&%! | Sciencx - » The Easiest Way to Create and Manage App Icons for React Native on IOS & Android. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/
CHICAGO
" » The Easiest Way to Create and Manage App Icons for React Native on IOS & Android." ?#@*&%! | Sciencx - Accessed . https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/
IEEE
" » The Easiest Way to Create and Manage App Icons for React Native on IOS & Android." ?#@*&%! | Sciencx [Online]. Available: https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/. [Accessed: ]
rf:citation
» The Easiest Way to Create and Manage App Icons for React Native on IOS & Android | ?#@*&%! | Sciencx | https://www.scien.cx/2021/08/15/the-easiest-way-to-create-and-manage-app-icons-for-react-native-on-ios-android/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.