0.0.8 • Published 7 years ago
react-native-active-keyboards v0.0.8
react-native-react-native-active-keyboards
This is a simple module to let you determine if a specific keyboard is installed. Particularly useful if you have created your own custom keyboard.
Getting started
$ npm install react-native-active-keyboards --save
Mostly automatic installation
$ react-native link react-native-active-keyboards
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-active-keyboardsand addRNReactNativeActiveKeyboards.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNReactNativeActiveKeyboards.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNReactNativeActiveKeyboardsPackage;to the imports at the top of the file - Add
new RNReactNativeActiveKeyboardsPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-active-keyboards' project(':react-native-active-keyboards').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-active-keyboards/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-active-keyboards')
Usage
import { keyboardEnabled } from "react-native-active-keyboards";
[...]
async componentWillMount() {
// @param keyboardId
const enabled = await keyboardEnabled("keyboardName");
console.log("IN APP", enabled);
}
[...]