{"_id":"@abumalick/expo-dynamic-app-icon","name":"@abumalick/expo-dynamic-app-icon","dist-tags":{"latest":"2.1.0"},"versions":{"2.1.0":{"name":"@abumalick/expo-dynamic-app-icon","version":"2.1.0","description":"Programmatically change the app icon in Expo.","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"expo-module build","build:plugin":"tsc --build ./plugin","clean":"expo-module clean","lint":"expo-module lint","test":"expo-module test","prepare":"expo-module prepare","prepublishOnly":"expo-module prepublishOnly","expo-module":"expo-module","open:ios":"open -a \"Xcode\" example/ios","open:android":"open -a \"Android Studio\" example/android"},"keywords":["react-native","expo","expo-dynamic-app-icon","ExpoDynamicAppIcon"],"repository":{"type":"git","url":"https://github.com/howincodes/expo-dynamic-app-icon"},"bugs":{"url":"https://github.com/howincodes/expo-dynamic-app-icon/issues"},"author":{"name":"Faris Basha T M","email":"bashahowin@gmail.com","url":"https://github.com/howincodes"},"license":"MIT","publishConfig":{"access":"public"},"homepage":"https://github.com/howincodes/expo-dynamic-app-icon#readme","dependencies":{"expo-modules-core":"^2.1.1","@expo/image-utils":"^0.6.3","xcode":"^3.0.1"},"devDependencies":{"@types/react":"^18.0.25","@types/react-native":"^0.70.6","expo-module-scripts":"^4.0.2"},"peerDependencies":{"expo":"^52","react":"*","react-native":"*"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","_id":"@abumalick/expo-dynamic-app-icon@2.1.0","dist":{"shasum":"4d30d2a2fa048965008c0490b00fcd83ef884372","integrity":"sha512-XvQjvjuhV55wYd5kfReJ+iaPtSpPcEvXfjYWUxNEM1y0yBXsqwDdI7g2nTzpsR/SYN1divXXF2GWlA6Hzqyjtg==","tarball":"https://registry.npmjs.org/@abumalick/expo-dynamic-app-icon/-/expo-dynamic-app-icon-2.1.0.tgz","fileCount":270,"unpackedSize":811583,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDqtAl8oUDXZ1l4dPamTHOTdfAzLej5fnc6MYusOw0HpAiBNdpLkHyk1EmHnJfeCTB8317s4V/p4eWKmsc4/VUe/ig=="}]},"_npmUser":{"name":"abumalick","email":"abdullah.hilson@gmail.com"},"directories":{},"maintainers":[{"name":"abumalick","email":"abdullah.hilson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/expo-dynamic-app-icon_2.1.0_1746824159479_0.23498963964175568"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-09T20:55:59.337Z","2.1.0":"2025-05-09T20:55:59.681Z","modified":"2025-05-09T20:56:00.192Z"},"maintainers":[{"name":"abumalick","email":"abdullah.hilson@gmail.com"}],"description":"Programmatically change the app icon in Expo.","homepage":"https://github.com/howincodes/expo-dynamic-app-icon#readme","keywords":["react-native","expo","expo-dynamic-app-icon","ExpoDynamicAppIcon"],"repository":{"type":"git","url":"https://github.com/howincodes/expo-dynamic-app-icon"},"author":{"name":"Faris Basha T M","email":"bashahowin@gmail.com","url":"https://github.com/howincodes"},"bugs":{"url":"https://github.com/howincodes/expo-dynamic-app-icon/issues"},"license":"MIT","readme":"# 🎨 @howincodes/expo-dynamic-app-icon\n\nEasily **change your app icon dynamically** in **Expo SDK 52**!\n\n## 🚀 **What's New in v2:**\n\n✨ **Android icon change without app restart!**\n✨ Seamless icon updates while the app stays running\n✨ Improved stability and performance\n\n## 🎁 **Features:**\n\n✅ Reset icon to default\n✅ Support for **round icons**\n✅ Different icons for **iOS and Android**\n✅ Dynamic icon variants for **iOS** (light, dark, tinted)\n✅ iOS icon update **with or without alert popup**\n✅ **Simple API** to get and set the app icon\n\n## Demo🚀\n\n![dynamic-icon-demo-5](https://github.com/user-attachments/assets/3dced15a-8d4e-4eb9-b76c-4c7c8fc9f59a)\n\n---\n\n## 📦 Installation\n\n```sh\nnpx expo install @howincodes/expo-dynamic-app-icon\n```\n\n---\n\n## 🔧 Setup\n\nAdd the plugin to your `app.json`:\n\n```json\n\"plugins\": [\n  [\n    \"@howincodes/expo-dynamic-app-icon\",\n    {\n      \"defaultLight\": {\n        \"ios\": \"./assets/ios_icon_light.png\",\n        \"android\": {\n          \"foregroundImage\": \"./assets/android_icon_light_fg.png\",\n          \"backgroundColor\": \"#FFFFFF\"\n        }\n      },\n      \"defaultDark\": {\n        \"ios\": \"./assets/ios_icon_dark.png\",\n        \"android\": {\n          \"foregroundImage\": \"./assets/android_icon_dark_fg.png\",\n          \"backgroundColor\": \"#121212\"\n        }\n      },\n      \"legacyRed\": {\n        \"ios\": \"./assets/ios_icon_red.png\",\n        \"android\": \"./assets/android_icon_red_legacy.png\" // Legacy string format still supported\n      },\n      \"dynamicTheme\": {\n        \"ios\": {\n          \"light\": \"./assets/ios_icon_themed_light.png\",\n          \"dark\": \"./assets/ios_icon_themed_dark.png\",\n          \"tinted\": \"./assets/ios_icon_themed_tinted.png\"\n        }\n        // Android can also use the adaptive format here if desired\n      }\n    }\n  ]\n]\n```\n\n**Note on Android Adaptive Icons:**\nFor Android, you can now provide an object with `foregroundImage` (path to your foreground asset) and `backgroundColor` (hex string) to generate proper adaptive icons. If you provide a direct string path, it will be treated as a legacy icon.\n\n---\n\n## 📜 Android Setup\n\nRun the following command:\n\n```sh\nexpo prebuild\n```\n\nThen, check if the following lines have been added to `AndroidManifest.xml`. The `android:icon` and `android:roundIcon` attributes will point to different resources based on your configuration:\n\n**For Adaptive Icons (example: `defaultDark`):**\n\n```xml\n<activity-alias\n  android:name=\"expo.modules.dynamicappicon.example.MainActivitydefaultDark\"\n  android:enabled=\"false\"\n  android:exported=\"true\"\n  android:icon=\"@mipmap/ic_launcher_adaptive_defaultdark\"\n  android:roundIcon=\"@mipmap/ic_launcher_adaptive_defaultdark\"\n  android:targetActivity=\".MainActivity\">\n  <intent-filter>\n    <action android:name=\"android.intent.action.MAIN\"/>\n    <category android:name=\"android.intent.category.LAUNCHER\"/>\n  </intent-filter>\n</activity-alias>\n```\n\n**For Legacy Icons (example: `legacyRed`):**\n\n```xml\n<activity-alias\n  android:name=\"expo.modules.dynamicappicon.example.MainActivitylegacyRed\"\n  android:enabled=\"false\"\n  android:exported=\"true\"\n  android:icon=\"@mipmap/legacyred\"\n  android:roundIcon=\"@mipmap/legacyred_round\"\n  android:targetActivity=\".MainActivity\">\n  <intent-filter>\n    <action android:name=\"android.intent.action.MAIN\"/>\n    <category android:name=\"android.intent.category.LAUNCHER\"/>\n  </intent-filter>\n</activity-alias>\n```\n\n---\n\n## 🚀 Usage\n\n### **Set App Icon**\n\n```typescript\nimport { setAppIcon } from \"@howincodes/expo-dynamic-app-icon\";\n\n/**\n * Change app icon to 'red'\n */\nsetAppIcon(\"red\");\n\n/**\n * Reset to default icon\n */\nsetAppIcon(null);\n```\n\n#### ✅ Available Parameters:\n\n```typescript\nsetAppIcon(\n  name: IconName | null,\n  isInBackground?: boolean\n)\n```\n\n| Parameter        | Type               | Default | Description                                                                                                                    |\n| ---------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| `name`           | `IconName \\| null` | `null`  | The icon name to switch to. Pass `null` to reset to the default icon.                                                          |\n| `isInBackground` | `boolean`          | `true`  | - `true`: Icon changes silently in the background (no alert on iOS).<br>- `false`: Immediate change, with system alert on iOS. |\n\n#### ✅ Returns:\n\n- `\"DEFAULT\"` if reset to the original icon.\n- The **new icon name** on success.\n- `false` if an error occurs.\n\n---\n\n### **Get Current Icon**\n\n```typescript\nimport { getAppIcon } from \"@howincodes/expo-dynamic-app-icon\";\n\n// Get the current app icon name\nconst icon = getAppIcon();\nconsole.log(icon); // \"red\" (or \"DEFAULT\" if not changed)\n```\n\n---\n\n### ⚠️ Notes:\n\n- **Android limitations:**\n  Android does **not** support icon changes while the app is running in the foreground.\n  To work around this, the icon is changed when the app enters the **Pause state** (background).\n\n- ⚠️ **Pause state** can also trigger during events like permission dialogs.\n  To avoid unwanted icon changes, a **5-second delay** is added to ensure the app is truly in the background.\n\n- To disable the delay and apply the icon change immediately (with the risk of it running during permission dialogs or other pause events), set:\n\n  ```typescript\n  setAppIcon(\"red\", false);\n  ```\n\n  - On **iOS**, `isInBackground: false` triggers the system alert immediately.\n  - On **Android**, it applies the icon change right away without waiting.\n\n## ☕ Support the Original Author\n\nA huge shoutout to [outsung](https://github.com/outsung) for the original package! 🎉\n\nIf you find this useful, consider **buying him a coffee**:\n\n<a href=\"https://www.buymeacoffee.com/outsung\" target=\"_blank\">\n  <img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\" />\n</a>\n\n---\n\n## 🌐 About Us\n\nThis package is maintained by **[HowinCloud](https://howincloud.com/)** – delivering powerful cloud-based solutions for modern app development.\n\n🔥 **Enjoy building dynamic and customizable apps with Expo!** 🚀\n","readmeFilename":"README.md","_rev":"1-436c0e3e6df0862637f0aacc1aac8285"}