WebViewGold Documentation · iOS
🇺🇸 English
Get WebViewGold

Haptic Feedback API

Trigger native haptic feedback (vibrations) from your web app for a truly native app feeling on iOS.

WebViewGold allows for the implementation of native iOS haptic control within your web app. Using our API, you are able to perform the following actions:

Light Impact
lighthaptic://
Used for a collision between small, light UI elements
Medium Impact
mediumhaptic://
Used for a collision between moderately sized UI elements
Heavy Impact
heavyhaptic://
Used for a collision between large, heavy UI elements
Success Notification
successhaptic://
Indicates a task or action has been successfully completed
Warning Notification
warninghaptic://
Indicates a task or action has produced a warning of some kind
Error Notificiation
errorhaptic://
Indicates that an error has occurred

We suggest previewing Apple's best practices overview before including these features into your application. An example of how this API can be utilised can be seen below, with an anchor tag and custom javascript function which interact with our haptic API.

<a onclick="lightHaptic('index.html')">Navigation Link with Haptics</a>

<script>
function lightHaptic(url) {
  if (isWebViewBrowser) {
    window.location.href = url;
    loadInnerHref("lighthaptic://");
  } else {
    window.location.href = url;
  }
}

function loadInnerHref(url) {
  iFrame = document.createElement("iframe");
  iFrame.setAttribute("src", url); 
  document.body.appendChild(iFrame);
  iFrame.parentNode.removeChild(iFrame);
  iFrame = null;
}
</script>

Click here to view a demonstration web page for this feature. Inspect the page to view the example code.

Too busy? We set up your app for you.

Our team configures, builds & submits your WebViewGold app — done-for-you, fast turnaround, Made in Germany.

Get your app set up →

Build in your browser

No Mac, no IDE: the WebViewGold Cloud Builder configures, builds & uploads your app online.

Discover Cloud Builder →