# React Native

Our React Native package allows playback of custom haptics on both Android and iOS in a cross-platform manner.

Find it on the npm registry and on GitHub for the full API reference.

# Usage

After exporting for iOS, add the exported files to your iOS application's main bundle. Similarly, after exporting for Android, move the exported files to your application's assets directory.

In your code, you can then easily trigger the haptic feedback:

import RNFS from 'react-native-fs';
import { playHaptics } from "react-native-hapticlabs";

playHaptics({
  iosPath: RNFS.MainBundlePath + "/Exported.ahap",
  androidPath: "Exported.hac",
}).then(() => {
  console.log("Haptics played");
});

A full working example for the usage can be found in our repo.