All Projects → capacitor-community → app-icon

capacitor-community / app-icon

Licence: MIT License
Capacitor plugin for managing an app's icon. The main feature being that you can programmatically change the app icon.

Programming Languages

swift
15916 projects
typescript
32286 projects
HTML
75241 projects
ruby
36898 projects - #4 most used programming language
CSS
56736 projects
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to app-icon

text-to-speech
⚡️ Capacitor plugin for synthesizing speech from text.
Stars: ✭ 50 (+78.57%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-vue-ionicv4-app
sample app using capacitor vuejs and ionicv4 components
Stars: ✭ 70 (+150%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-branch-deep-links
Capacitor plugin for branch.io deep links
Stars: ✭ 22 (-21.43%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-firebase-authentication
⚡️ Capacitor plugin for Firebase Authentication.
Stars: ✭ 67 (+139.29%)
Mutual labels:  capacitor, capacitor-plugin
keep-awake
⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.
Stars: ✭ 69 (+146.43%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-site
Capacitor website
Stars: ✭ 0 (-100%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-rate-app
Let users rate your app using native review app dialog for both Android and iOS.
Stars: ✭ 88 (+214.29%)
Mutual labels:  capacitor, capacitor-plugin
XREngine
Immersive infrastructure for everyone. Everything you need to build and deploy scalable realtime 3D social apps and more. 🤖 🚀 👓 🚀 🕹️ 🚀 🧑🏿‍🚀
Stars: ✭ 423 (+1410.71%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-android-dark-mode-support
⚡️ Capacitor plugin to support dark mode on Android.
Stars: ✭ 23 (-17.86%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-filesharer
Capacitor plugin to download and share files for the Web, Android and iOS! Stop the war in Ukraine!
Stars: ✭ 55 (+96.43%)
Mutual labels:  capacitor, capacitor-plugin
capacitor-background-task
⚡️ Capacitor plugin for running background tasks.
Stars: ✭ 27 (-3.57%)
Mutual labels:  capacitor, capacitor-plugin
appcenter-sdk-capacitor
Capacitor Plugin for Microsoft's Visual Studio App Center SDK.
Stars: ✭ 22 (-21.43%)
Mutual labels:  capacitor, capacitor-plugin
firebase-analytics
Enable Firebase Analytics for Capacitor Apps
Stars: ✭ 123 (+339.29%)
Mutual labels:  capacitor
firebase-crashlytics
⚡️ Capacitor plugin for Firebase Crashlytics.
Stars: ✭ 63 (+125%)
Mutual labels:  capacitor
app
Source code of intencje.pl website and mobile/desktop apps based on Angular, Firebase, and Capacitor.
Stars: ✭ 12 (-57.14%)
Mutual labels:  capacitor
larasar
Laravel + Quasar Framework
Stars: ✭ 77 (+175%)
Mutual labels:  capacitor
blobile
Blases Loaded - Unofficial Live Blaseball Game Viewer for iOS, Android, and Web
Stars: ✭ 16 (-42.86%)
Mutual labels:  capacitor
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+64.29%)
Mutual labels:  capacitor
ionic-firebase-image-upload
Building an Ionic App with Protected/Private Content. This app shows how to use Firebase Storage from an Ionic Angular app both with public and private content.
Stars: ✭ 19 (-32.14%)
Mutual labels:  capacitor
ionic-vue-mobile-template-01
Hybrid app template built with vue, ionic and capacitor.
Stars: ✭ 47 (+67.86%)
Mutual labels:  capacitor


App Icon

@capacitor-community/app-icon

Capacitor community plugin for managing an iOS app's icon. The main feature being that you can programmatically change the app icon.


Maintainers

Maintainer GitHub Social
John Borges johnborges @johnborges

Before Starting

This plugin only changes the main app icon on the device homescreen. The icon in springboard and in other areas of iOS will not change and continue to show the original.

Changing the app icon is only allowed when the app is in the foreground.

Installation

npm install @capacitor-community/app-icon
npx cap sync

Configuration

Add Alternate Icons

The alternate icons need to be included within the app bundle and referenced in the iOS project Info.plist prior to using this plugin. It is not possible to switch to any icon on the fly without adding it to the iOS project first.

Add the alternate icons directly to your iOS project or in a subdirectory.

Setup Info.plist

Add the CFBundleIcons key to Info.plist with CFBundleAlternateIcons dictionary. Each alternate icon needs to be specified.

Providing every resolution for each alternative is not required. By including the icon with the highest supported resolution, iOS will handle the other resolutions by scalling down the large one provided.

From Apple:

When specifying icon filenames, it is best to omit any filename extensions. Omitting the filename extension lets the system automatically detect high-resolution (@2x) versions of your image files using the standard-resolution image filename. If you include filename extensions, you must specify all image files (including the high-resolution variants) explicitly. The system looks for the icon files in the main resources directory of the bundle.

<key>CFBundleIcons</key>
<dict>
  <key>CFBundleAlternateIcons</key>
  <dict>
    <!-- The names to reference in your code -->
    <key>ionic-icon</key>
    <dict>
      <key>UIPrerenderedIcon</key>
      <true/>
      <key>CFBundleIconFiles</key>
      <array>
        <!-- Filenames-->
        <string>ionic-icon</string>
      </array>
    </dict>
    <!-- ... additional alternates if any ... -->
  </dict>
</dict>

Supporting iPad

For iPad specific version of an icon, there is an additional key to add in Info.plist.

<key>CFBundleIcons~ipad</key>
<dict>
  <!-- same as above  -->
</dict>

Usage

import { AppIcon } from '@capacitor-community/app-icon';

const changeIcon = async (iconName) => {

  await AppIcon.change({name: iconName, suppressNotification: true});

}

API

isSupported()

isSupported() => Promise<{value: boolean}>

Checks to see if using alternate icons is supported on your device.


getName()

getName(): Promise<{value: string | null}>;

Gets the name of currently set alternate icon. If original icon is set, returns null.


change(...)

change(options: IconOptions): Promise<void>;

Changes app icon to specified alternate.

Param Type
options IconOptions

reset(...)

reset(options: ResetOptions): Promise<void>;

Changes app icon to specified alternate.

Param Type
options ResetOptions

Interfaces

IconOptions

Represents the options passed to change.

Prop Type Description Since
name string Name of alternate icon to set. 1.0.0
suppressNotification boolean Flag controlling the in app notification which shows after icon is changed. 1.0.0

ResetOptions

Represents the options passed to reset.

Prop Type Description Since
suppressNotification boolean Flag controlling the in app notification which shows after icon is changed. 1.0.0

Contributors

Thanks goes to these wonderful people (emoji key):


John Borges

💻

Simon Grimm

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].