diff --git a/README.md b/README.md index 6468641..1b83385 100644 --- a/README.md +++ b/README.md @@ -198,3 +198,11 @@ export default combineReducers({ connect: (state = null) => state }) ``` + +## Vibration + +Error toasts will vibrate the device if vibration is supported. For compatibility with Android add the following to `AndroidManifest.xml` + +```xml + +``` diff --git a/src/Toast.js b/src/Toast.js index f60174c..fc4cc38 100644 --- a/src/Toast.js +++ b/src/Toast.js @@ -3,7 +3,8 @@ import { Animated, TouchableWithoutFeedback, View, - Text + Text, + Vibration } from 'react-native' import ToastStyles from './ToastStyles' @@ -49,6 +50,8 @@ class Toast extends Component { .timing(animatedValue, { toValue: 1, duration: 350 }) .start() + Vibration.vibrate() + const { duration, onShow } = this.props const timeoutId = setTimeout(() => this.hideToast(), duration + 350)