10

I want to utilize the 3D touch support in iOS through Native Script. Currently there is a Plugin for Quick actions, however i want to listen to ForceTouch actions of iOS devices. I want to do this using native iOS API but i am not sure how to get started.
There is another plugin for Cordova by the same author, where there is a function which we can listen for force touches like below:

ThreeDeeTouch.watchForceTouches(function(result) {
    console.log("force touch % " + result.force); // 84
    console.log("force touch timestamp " + result.timestamp); // 1449908744.706419
    console.log("force touch x coordinate " + result.x); // 213
    console.log("force touch y coordinate " + result.y); // 41
  });

How can i access to 3D Touch API in NativeScript iOS?

Idrees Khan
  • 7,702
  • 18
  • 63
  • 111

1 Answers1

2

Since force touch does not have a similar function in Android, there is no NativeScript abstraction. You will have to use the iOS libraries themselves.

How to use Native Libraries

iOS force Touch documentation

Richard Hubley
  • 2,180
  • 22
  • 29