README
react-native-emojis
Getting started
$ npm install react-native-emojis --save
Mostly automatic installation
$ react-native link react-native-emojis
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.ReactNativeEmojisPackage;
to the imports at the top of the file - Add
new ReactNativeEmojisPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-emojis' project(':react-native-emojis').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-emojis/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-emojis')
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-emojis
and addRNReactNativeEmojis.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativeEmojis.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
Usage
import EmojiChecker from 'react-native-emojis';
// Both platforms
const emojisList = [{ char: 'U+1F631' }]
const result = await EmojiChecker.canShowEmojis(emojisList);
// result => [{ char: 'U+1F631', visible: true }]
// Android only
const emoji = 'U+1F631'
const result = await EmojiChecker.canShowEmoji(emoji);
// result => true
const result = await EmojiChecker.convertToSupportedEmoji(emoji);
// result => 'U+1F632'