react-native-android-icon-badge

Library for displaying Icon Badge on Android using this https://github.com/leolin310148/ShortcutBadger

Usage no npm install needed!

<script type="module">
  import reactNativeAndroidIconBadge from 'https://cdn.skypack.dev/react-native-android-icon-badge';
</script>

README

react-native-android-icon-badge

Getting started

$ npm install react-native-android-icon-badge --save

Mostly automatic installation

$ react-native link react-native-android-icon-badge

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNAndroidIconBadgePackage; to the imports at the top of the file
  • Add new RNAndroidIconBadgePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-android-icon-badge'
    project(':react-native-android-icon-badge').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-android-icon-badge/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-android-icon-badge')
    

Usage

import RNAndroidIconBadge from 'react-native-android-icon-badge';

// TODO: What to do with the module?
RNAndroidIconBadge;