You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://www.npmjs.com/package/react-native-haptic-patterns)
[](https://www.npmjs.com/package/react-native-haptic-patterns)[](https://www.npmtrends.com/react-native-haptic-patterns)[](https://packagephobia.com/result?p=react-native-haptic-patterns)[](https://www.android.com)[](https://developer.apple.com/ios)[](https://opensource.org/licenses/MIT)
11
6
12
7
A React Native library for creating and playing customizable haptic feedback patterns on iOS and Android. Supports advanced pattern recording and playback, enabling developers to deliver rich, tactile experiences in their mobile applications.
13
8
14
9
---
15
10
11
+
## ✨ Features
12
+
13
+
- ✅ **Cross-platform support** - Works seamlessly on both iOS and Android
14
+
- ✅ **Custom haptic patterns** - Create your own vibration patterns with precise control
15
+
- ✅ **Pattern recording & playback** - Record and replay complex haptic sequences
To better understand how to use these methods in a real-world scenario, refer to the following full working example project:
157
301
158
302
[Example App](./example/src/App.tsx): Demonstrates how to record, play, and reset custom haptic patterns using the library's API in a React Native application.
159
303
304
+
### Common Use Cases
305
+
306
+
**Button Press Feedback**
307
+
308
+
```tsx
309
+
<TouchableOpacity
310
+
onPress={() => {
311
+
HapticPatterns.playHapticPattern(50);
312
+
// Handle button action
313
+
}}>
314
+
<Text>Press Me</Text>
315
+
</TouchableOpacity>
316
+
```
317
+
318
+
**Success/Error Notifications**
319
+
320
+
```tsx
321
+
const showSuccessNotification = () => {
322
+
HapticPatterns.playHapticPattern(100); // Single haptic
- Verify the `VIBRATE` permission is in the correct location in `AndroidManifest.xml`
388
+
- Check that the permission is not being removed by other configurations
389
+
390
+
### General
391
+
392
+
**Module not found errors**
393
+
394
+
- Ensure the package is properly installed: `npm install` or `yarn install`
395
+
- Try resetting Metro bundler cache: `npx react-native start --reset-cache`
396
+
- Rebuild the app completely: `npx react-native run-ios` or `npx react-native run-android`
397
+
398
+
---
399
+
160
400
## Acknowledgements
161
401
162
402
This library uses and modifies the iOS implementation from [react-native-core-haptics-api](https://github.com/insanj/react-native-core-haptics-api) for customization.
@@ -167,7 +407,7 @@ Support it by joining [stargazers](https://github.com/SimformSolutionsPvtLtd/rea
167
407
168
408
## Bugs / Feature requests / Feedbacks
169
409
170
-
For bugs, feature requests, and discussion please use [GitHub Issues](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=bug&late=BUG_REPORT.md&title=%5BBUG%5D%3A), [GitHub New Feature](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=enhancement&late=FEATURE_REQUEST.md&title=%5BFEATURE%5D%3A), [GitHub Feedback](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=enhancement&late=FEATURE_REQUEST.md&title=%5BFEEDBACK%5D%3A)
410
+
For bugs, feature requests, and discussion please use [GitHub Issues](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=bug&template=BUG_REPORT.md&title=%5BBUG%5D%3A), [GitHub New Feature](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=enhancement&template=FEATURE_REQUEST.md&title=%5BFEATURE%5D%3A), [GitHub Feedback](https://github.com/SimformSolutionsPvtLtd/react-native-haptic-patterns/issues/new?labels=enhancement&template=FEATURE_REQUEST.md&title=%5BFEEDBACK%5D%3A)
0 commit comments