New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-alternate-icons

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-alternate-icons

React Native Alternate Icons for iOS 10.3+

latest
Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
113
-2.59%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-alternate-icons

React Native Alternate Icons for iOS 10.3+

Demo

Requirements

  • React Native 0.44+ (only tested on 0.44)

Installation

npm install react-native-alternate-icons@latest --save
react-native link

Manual Linking

https://facebook.github.io/react-native/docs/linking-libraries-ios.html

Preparation & Code Sample

Preparation

Add your icons into your Xcode Project

Icons in your Xcode Project

Add the following code to your info.plist

<key>supportsAlternateIcons</key>
<true/>
<key>CFBundleIcons</key>
<dict>
  <key>CFBundlePrimaryIcon</key>
  <dict>
    <key>CFBundleIconFiles</key>
    <array>
      <string>icon</string>
    </array>
    <key>UIPrerenderedIcon</key>
    <false/>
  </dict>
  <key>CFBundleAlternateIcons</key>
  <dict>
    <key>Red</key>
    <dict>
      <key>CFBundleIconFiles</key>
      <array>
        <string>Red</string>
      </array>
      <key>UIPrerenderedIcon</key>
      <false/>
    </dict>
  </dict>
</dict>

Using in your React Native applications

import Icons from 'react-native-alternate-icons';

/** Change the icons of your application */
Icons.setIconName( iconName );
/** get Current Icon Name */
Icons.getIconName( callback( result ) );
/** Reset the icon of your application to the default */
Icons.reset();
/** Check if your device does support alternate icons, android returns always false */
Icons.supportDevice( callback( result ) );

Keywords

react-component

FAQs

Package last updated on 30 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts