Search code examples
javascriptios3dtouchpressure.js

iOS 3D Touch API using Javascript for Web App


The iPhones 6s has 3D touch API for native apps. I was wondering if Apple has enabled 3D touch access from Javascript for a web app?

Just like we use standard touch events

element.addEventListener("touchstart", handleStart, false);


Solution

  • Safari 9 supports it on desktop. See Responding to Force Touch Events from JavaScript in Apple's WebKit DOM Programming Topics.

    I can't find any documentation on using it from Safari 9 on iOS, though.