iOS 3D Touch Support in Native Script
Asked Answered
G

1

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?

Glycosuria answered 6/5, 2017 at 18:59 Comment(0)
D
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

Dorser answered 21/6, 2017 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.