{"id":15305110,"url":"https://github.com/eddyverbruggen/nativescript-app-icon-changer","last_synced_at":"2025-06-30T20:34:52.451Z","repository":{"id":57308388,"uuid":"92739869","full_name":"EddyVerbruggen/nativescript-app-icon-changer","owner":"EddyVerbruggen","description":"Change the homescreen icon of your NativeScript iOS app at runtime!","archived":false,"fork":false,"pushed_at":"2017-09-28T10:41:44.000Z","size":15379,"stargazers_count":16,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-20T07:01:37.158Z","etag":null,"topics":["icon","ios","nativescript","nativescript-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-29T12:54:35.000Z","updated_at":"2024-05-30T16:07:29.000Z","dependencies_parsed_at":"2022-09-10T03:31:19.636Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-app-icon-changer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/EddyVerbruggen/nativescript-app-icon-changer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-app-icon-changer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-app-icon-changer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-app-icon-changer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-app-icon-changer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-app-icon-changer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-app-icon-changer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262846729,"owners_count":23373864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["icon","ios","nativescript","nativescript-plugin"],"created_at":"2024-10-01T07:59:05.318Z","updated_at":"2025-06-30T20:34:52.364Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript App Icon Changer\n\n[![Build Status][build-status]][build-url]\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[build-status]:https://travis-ci.org/EddyVerbruggen/nativescript-app-icon-changer.svg?branch=master\n[build-url]:https://travis-ci.org/EddyVerbruggen/nativescript-app-icon-changer\n[npm-image]:http://img.shields.io/npm/v/nativescript-app-icon-changer.svg\n[npm-url]:https://npmjs.org/package/nativescript-app-icon-changer\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-app-icon-changer.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\n\u003cimg src=\"https://github.com/EddyVerbruggen/nativescript-app-icon-changer/raw/master/media/demo.gif\" width=\"338px\" height=\"604px\" /\u003e\n\n\u003e That's [the demo app](https://github.com/EddyVerbruggen/nativescript-app-icon-changer/tree/master/demo) in action, switching app icons like a boss!\n\n## Installation\n```bash\ntns plugin add nativescript-app-icon-changer\n```\n\n## API\n\n### requiring / importing the plugin\nAll examples below assume you're using TypeScript, but here's how to require the plugin with regular JS as well:\n\n#### JavaScript\n```js\nvar AppIconChangerPlugin = require(\"nativescript-app-icon-changer\");\nvar appIconChanger = new AppIconChangerPlugin.AppIconChanger();\n```\n\n#### TypeScript\n```typescript\nimport { AppIconChanger } from \"nativescript-app-icon-changer\";\n\nexport class MyClass {\n  private appIconChanger: AppIconChanger;\n  \n  constructor() {\n    this.appIconChanger = new AppIconChanger();\n  }\n}\n```\n\n### `isSupported`\nOnly iOS 10.3 and up support this feature, so you may want to check beforehand: \n\n```typescript\nthis.appIconChanger.isSupported().then(\n    supported =\u003e console.log(`Supported: ${supported}`));\n```\n\n### `changeIcon`\nTo be able to switch to a different icon add it to `App_Resources/iOS` and `App_Resources/iOS/Info.plist` as explained below and pass `iconName` to `changeIcon`.\n\nTo reset to the default icon, use `iconName: null`.\n\nNote 1: iOS will notify the user the icon changed, but this plugin allows you to suppress that message (it's the default even). It's probably not what Apple would like you to do, but no apps have been disapproved with suppression enabled.\n\nNote 2: Changing the app icon is only allowed when the app is in the foreground, so forget about that weather app which silently updates its app icon.\n\n```typescript\nthis.appIconChanger.changeIcon({\n  iconName: \"icon-blue\", // or null to reset to the default\n  suppressUserNotification: true\n});\n```\n\n### `currentAlternateIcon`\nWant to know whether or not the app currently has an alternate icon configured? And if so, what its name is? Then use this:\n\n```typescript\n// synchronous\nconst currentAppIconName: string = this.appIconChanger.currentAlternateIcon();\n```\n\n## Preparing your app for icon switching\nApple doesn't allow switching to arbitrary icons, so they must be bundled with your app before releasing the app to the store.\n\nAdd the icons you'd like your users to be able to switch to for all relevant resolutions as usual.\n\n\u003e Note that you DON'T NEED to provide all those resolutions; you could get away with adding just the largest resolution and refer to it in the plist file. iOS will scale it down to other resolutions for you.\n \n\u003cimg src=\"https://github.com/EddyVerbruggen/nativescript-app-icon-changer/raw/master/media/icon-listing.png\" width=\"236px\" height=\"266px\" /\u003e\n\nThen reference those icons in `App_Resources/iOS/Info.plist` as well:\n\n```xml\n\u003cplist\u003e\n\u003cdict\u003e\n\n  \u003c!-- Add or merge this bit --\u003e\n  \u003ckey\u003eCFBundleIcons\u003c/key\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eCFBundleAlternateIcons\u003c/key\u003e\n    \u003cdict\u003e\n      \u003c!-- The name you use in code --\u003e\n      \u003ckey\u003eicon-blue\u003c/key\u003e\n      \u003cdict\u003e\n        \u003ckey\u003eUIPrerenderedIcon\u003c/key\u003e\n        \u003ctrue/\u003e\n        \u003ckey\u003eCFBundleIconFiles\u003c/key\u003e\n        \u003carray\u003e\n          \u003c!-- The actual filenames. Don't list the @2x/@3x files here --\u003e\n          \u003cstring\u003eicon-blue-57\u003c/string\u003e\n          \u003cstring\u003eicon-blue-60\u003c/string\u003e\n          \u003cstring\u003eicon-blue-72\u003c/string\u003e\n          \u003cstring\u003eicon-blue-76\u003c/string\u003e\n        \u003c/array\u003e\n      \u003c/dict\u003e\n    \u003c/dict\u003e\n  \u003c/dict\u003e\n\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\n\u003e Need iPad support as well? Just duplicate that plist config and change `\u003ckey\u003eCFBundleIcons\u003c/key\u003e` to `\u003ckey\u003eCFBundleIcons~ipad\u003c/key\u003e`.\n\nWant to see this configured in an actual project? Look at [the demo app](https://github.com/EddyVerbruggen/nativescript-app-icon-changer/tree/master/demo/app/App_Resources/iOS) to see the gory details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-app-icon-changer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-app-icon-changer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-app-icon-changer/lists"}