Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 3D Touch Support in Native Script

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?

like image 708
Idrees Khan Avatar asked May 06 '17 18:05

Idrees Khan


1 Answers

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

like image 96
Richard Hubley Avatar answered Oct 20 '22 16:10

Richard Hubley