RORK LABJP
FUNDING — Rork raised a $15M seed led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z Speedrun joiningENGINE — Rork Max runs on Claude Code and Claude Opus 4.6; it drew 8M+ views on X and doubled annual revenue in two weeksSWIFT — Rork Max is the first web-based Swift app builder, positioned to replace Apple's traditional XcodePRODUCT — Rork Max covers the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageCLASSIC — The original Rork uses React Native (Expo), building iOS/Android apps from a plain-English descriptionPRICING — Start free; paid plans begin at $25/mo, and Rork Max is $200/moFUNDING — Rork raised a $15M seed led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z Speedrun joiningENGINE — Rork Max runs on Claude Code and Claude Opus 4.6; it drew 8M+ views on X and doubled annual revenue in two weeksSWIFT — Rork Max is the first web-based Swift app builder, positioned to replace Apple's traditional XcodePRODUCT — Rork Max covers the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageCLASSIC — The original Rork uses React Native (Expo), building iOS/Android apps from a plain-English descriptionPRICING — Start free; paid plans begin at $25/mo, and Rork Max is $200/mo
Articles/Dev Tools
Dev Tools/2026-06-24Advanced

Building a Breathing-Paced Haptic for a Meditation App with CoreHaptics

Canned expo-haptics buzzes can't produce the swell of a breath. Here is how to call CoreHaptics continuous events and parameter curves from an Expo native module to build a haptic synced to 4-7-8 breathing, with working Swift and TypeScript code.

Rork444CoreHapticsExpo98Native Module2Indie Dev31

Premium Article

When I shipped a small meditation and breathing app, built as an indie developer, the on-screen circle would expand and contract slowly, yet nothing reached the fingertips. People use this kind of app with their eyes closed, and I was guiding the breath with vision alone.

So I added expo-haptics and tried buzzing on the inhale and exhale cues. But Haptics.impactAsync() can only produce a single, instantaneous tap. What I wanted was a wave that swells over four seconds, pauses, and then fades over eight — something that rides along with the breath itself. No amount of stacking single taps gives you that continuous sensation.

The Taptic Engine in an iPhone is capable of far more nuance than that, and CoreHaptics is the API that unlocks it. Here we'll build a breath-synced haptic using CoreHaptics continuous events and parameter curves, then wrap it as an Expo native module so a React Native app (one generated with Rork) can call it — with the implementation code as we go.

Why expo-haptics alone never becomes a breath

expo-haptics exposes two broad families: the impact feedback of impactAsync(style) (light / medium / heavy) and the success/warning/error cues of notificationAsync(type). Both are designed to fire a single, very short, predefined pattern once.

A breathing wave needs something different in kind. What's missing comes down to three things:

  1. Duration — a continuous vibration that lasts several uninterrupted seconds
  2. A changing strength — the intensity rising and falling smoothly within those seconds
  3. Phase control — being able to specify the inhale, hold, and exhale phases in seconds

expo-haptics offers none of these. Scheduling presets with setTimeout leaves silent gaps between them, so you get a dotted line instead of a wave. To let someone feel the breath in their fingertips, you have to design the vibration as a continuous event and move its strength along a curve over time. That is exactly what CoreHaptics does.

What you wantexpo-hapticsCoreHaptics
A momentary tapGreat at itPossible (transient event)
A multi-second continuous buzzNot possibleContinuous event
Smoothly varying strength over timeNot possibleParameter curve
Ease of adoptionA few linesNeeds a native module

So it isn't an either/or choice. The pragmatic path is to leave taps to expo-haptics and add only the breathing wave through CoreHaptics. That's the arrangement I settled on myself.

CoreHaptics continuous events and parameter curves

The key to expressing a breath with CoreHaptics is combining the continuous type of CHHapticEvent with CHHapticParameterCurve.

A continuous event lets you say "hold a vibration for this many seconds." A parameter curve then controls how the intensity moves over that span, described by control points. For the inhale, ramp from 0 up slowly; for the exhale, fall from the peak back down to 0. That curve is the breathing wave.

Both intensity and sharpness take values from 0.0 to 1.0. Lowering sharpness rounds off the edges, giving a soft, gentle buzz. In a meditation app, keeping sharpness around 0.3 removes the stabbing quality and lets the haptic blend into the breath.

Here is one cycle of 4-7-8 breathing — inhale 4s, hold 7s, exhale 8s — assembled in Swift.

import CoreHaptics
 
func makeBreathPattern(inhale: Double, hold: Double, exhale: Double) throws -> CHHapticPattern {
    let sharp = CHHapticEventParameter(parameterID: .hapticSharpness, value: 0.3)
 
    // Inhale: continuous event ramping strength 0 -> 0.8
    let inhaleEvent = CHHapticEvent(
        eventType: .hapticContinuous,
        parameters: [
            CHHapticEventParameter(parameterID: .hapticIntensity, value: 0.8),
            sharp
        ],
        relativeTime: 0,
        duration: inhale)
 
    let inhaleCurve = CHHapticParameterCurve(
        parameterID: .hapticIntensityControl,
        controlPoints: [
            .init(relativeTime: 0,      value: 0.0),
            .init(relativeTime: inhale, value: 1.0)
        ],
        relativeTime: 0)
 
    // Exhale: continuous event falling 0.8 -> 0, offset by the hold
    let exhaleStart = inhale + hold
    let exhaleEvent = CHHapticEvent(
        eventType: .hapticContinuous,
        parameters: [
            CHHapticEventParameter(parameterID: .hapticIntensity, value: 0.8),
            sharp
        ],
        relativeTime: exhaleStart,
        duration: exhale)
 
    let exhaleCurve = CHHapticParameterCurve(
        parameterID: .hapticIntensityControl,
        controlPoints: [
            .init(relativeTime: exhaleStart,          value: 1.0),
            .init(relativeTime: exhaleStart + exhale, value: 0.0)
        ],
        relativeTime: 0)
 
    // The 7s hold has no event at all -- silence is the "hold your breath" phase
    return try CHHapticPattern(
        events: [inhaleEvent, exhaleEvent],
        parameterCurves: [inhaleCurve, exhaleCurve])
}

The crucial move is placing no event during the hold. The silence itself becomes the experience of holding your breath. Wrap two continuous events — inhale and exhale — in intensity curves, and the outline of a breath appears under the fingertips.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
You can design a continuous haptic whose strength rises and falls over several seconds using CoreHaptics parameter curves — something expo-haptics simply cannot do
You'll wrap CHHapticEngine in an Expo Modules API (Swift) module so React can call it by passing inhale/hold/exhale seconds
You'll handle the four traps every production app hits: engine auto-stop, foreground resume, unsupported hardware, and Low Power Mode
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-06-20
Bugs Rork Can Fix vs. Bugs You Should Fix Yourself: A Triage Workflow for Exported Code
A practical triage workflow for telling apart the bugs Rork resolves on its own from the ones you should hand-fix in exported React Native/Expo code, with working examples.
Dev Tools2026-06-24
When EAS Update Ships but the Bug Won't Die — Why OTA Stalls Silently, and How I Operate Around It
EAS Update can succeed and still fail to reach a slice of your users. These are field notes on runtimeVersion drift, updates that publish but never get adopted, and choosing the right rollback — with the instrumentation that actually helped on my Rork apps.
Dev Tools2026-06-23
The Private Screen That Lingers in the App Switcher — Hiding the Snapshot iOS Takes the Moment You Background Your App
When you send a React Native app generated by Rork to the background, iOS photographs the current screen for the App Switcher and writes it to disk. Journals and personal input screens linger there in plain sight. This walks through the iOS privacy overlay (why inactive, not background), Android's FLAG_SECURE, scoping it to sensitive screens only, and screenshot detection — all in working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →