README
@jamster/react-native-toast
Getting started
$ npm install @jamster/react-native-toast --save
Mostly automatic installation
$ react-native link @jamster/react-native-toast
Manual installation
iOS
This is not currently supported.
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.jamster.toast.RNToastPackage;
to the imports at the top of the file - Add
new RNToastPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':@jamster_react-native-toast' project(':@jamster_react-native-toast').projectDir = new File(rootProject.projectDir, '../node_modules/@jamster/react-native-toast/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':@jamster_react-native-toast')
Usage
import JsToast from '@jamster/react-native-toast'
// TODO: What to do with the module?
JsToast.show('Awesome', JsToast.LONG)