1.0.0 • Published 7 years ago

cordova-plugin-changeicon v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

Cordova Plugin Change-Icon

This plugin only works for iOs > 10.3. It is not currently possible to do such a thing on Android.

Based on https://medium.com/@same7mabrouk/ios-10-3-alternate-app-icons-2abd7b4c0a38

Installation

Please read this medium :

https://medium.com/@thibaut_47895/how-to-use-alternateicons-with-ionic-cordova-ca1fad7279b1

Uses cases and limitations

See https://ikiwitech.com/2017/05/08/change-your-ios-application-icon-runtime/

Functions

ChangeIcon.reset(Function success, Function failure) To reset and go back to the default icon

ChangeIcon.getCurrent(Function success, Function failure) To get the current icon used

ChangeIcon.change(String iconName ,Function success, Function failure) To change the current icon

Info.plist file

developer should declare all alternate icons in info.list. define CFBundleIcons key that contain 2 sub keys CFBundlePrimaryIcon and CFBundleAlternateIcons. In this case the problem is that developer should give up Asset catalog for icons and go back to the old method with .png resources.

<key>CFBundleIcons</key>
 <dict>
  <key>CFBundleAlternateIcons</key>
  <dict>
   <key>blue</key>
   <dict>
    <key>CFBundleIconFiles</key>
    <array>
     <string>blue</string>
    </array>
    <key>UIPrerenderedIcon</key>
    <false/>
   </dict>
  </dict>
  <key>CFBundlePrimaryIcon</key>
  <dict>
   <key>CFBundleIconFiles</key>
   <array>
    <string>icon</string>
   </array>
   <key>UIPrerenderedIcon</key>
   <false/>
  </dict>
 </dict>