### Run Example Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Instructions for running the provided example, which generates an icon with a badge. ```bash pnpm start ``` -------------------------------- ### Start Expo App Source: https://github.com/obytes/app-icon-badge/blob/master/demo/README.md Starts the Expo development server, allowing you to preview the app on various platforms. ```bash npx expo start ``` -------------------------------- ### Install Dependencies Source: https://github.com/obytes/app-icon-badge/blob/master/demo/README.md Installs all necessary project dependencies using npm. ```bash npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Instructions for installing project dependencies using pnpm, a package manager. ```bash cd app-icon-badge pnpm install ``` -------------------------------- ### Install App Icon Badge Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Instructions for installing the app-icon-badge package using different package managers like yarn, npm, and pnpm. ```bash ## Using yarn yarn add app-icon-badge ## Using npm npm install app-icon-badge ## Using pnpm pnpm add app-icon-badge ``` -------------------------------- ### Add Badge Example Source: https://github.com/obytes/app-icon-badge/blob/master/README.md An example demonstrating how to use the 'add-badge' command with specific options to add a banner badge to an icon. ```bash npx app-icon-badge ./example/icon.png --type=banner --text=hello --position=top --background=#45f4ee --color=black ``` -------------------------------- ### CLI Tool Usage Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Provides the general usage instructions for the app-icon-badge CLI tool, including available commands and global options. ```bash Usage: app-icon-badge [options] [command] command line for app-icon-badge Options: -V, --version output the version number -h, --help display help for command Commands: add-badge [options] add badge to icon using add-badge by default use-config use json file as a config help [command] display help for command ``` -------------------------------- ### Reset Project Source: https://github.com/obytes/app-icon-badge/blob/master/demo/README.md Resets the project by moving starter code to 'app-example' and creating a blank 'app' directory for new development. ```bash npm run reset-project ``` -------------------------------- ### Add Badge Command Usage Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Details the usage of the 'add-badge' command, including required arguments and available options for customizing the badge. ```bash Usage: app-icon-badge add-badge [options] add badge to the icon runs by default you don't need to specify this command Arguments: iconPath required argument, icon path Options: -t, --type required option (choices: "banner", "ribbon") -x, --text required option you need to provide text value -p, --position badge position banner:top,bottom and ribbon:left,right (choices: "top", "left", "right", "bottom") -b, --background badge background color -c, --color badge color (choices: "white", "black", default: "white") ``` -------------------------------- ### Library Usage for Adding Badges Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Demonstrates how to use the addBadge function from the app-icon-badge library to programmatically add badges to icons in any React Native project. ```javascript import { addBadge } from 'app-icon-badge'; import path from 'path'; const icon = path.resolve(__dirname, './assets/icon.png'); addBadge({ icon, dstPath: './assets/icon.environment.png', // optional, if not provided the icon will be generated in the same directory as the original icon under the name 'icon.result.png' badges: [ { text: 'staging', type: 'banner', color: 'white', // by default it will be white and the only color supported for now is white and black background: '#FF0000', // by default it will be black and we are only supporting hex format for colors }, { text: 'V1.0.1', type: 'ribbon', }, ], }); ``` -------------------------------- ### Expo Plugin Configuration Source: https://github.com/obytes/app-icon-badge/blob/master/README.md Configures the app-icon-badge plugin in Expo's app.config.js. This allows automatic generation of badged icons for Expo projects. ```typescript import type { ConfigContext, ExpoConfig } from '@expo/config'; import type { AppIconBadgeConfig } from 'app-icon-badge/types'; const VERSION = '1.0.1'; const APP_ENV = 'QA'; const appIconBadgeConfig: AppIconBadgeConfig = { enabled: true, // enable/ disable the plugin based on the environment (usually disabled for production builds) badges: [ { text: APP_ENV, // banner text type: 'banner', // banner or ribbon color: 'white', // by default it will be white and the only color supported for now is white and black background: '#FF0000', // by default it will be black and we are only supporting hex format for colors }, { text: VERSION, type: 'ribbon', }, ], }; export default ({ config }: ConfigContext): ExpoConfig => ({ ...config, name: 'my-app', icon: './assets/icon.png', android: { adaptiveIcon: { foregroundImage: './assets/adaptive-icon.png', backgroundColor: '#FFFFFF', }, }, plugins: [['app-icon-badge', appIconBadgeConfig]], }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.