
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@nativescript/haptics
Advanced tools
A plugin that allows you to add haptics to your app.
Playing haptics can engage people's sense of touch and bring their familiarity with the physical world into your app or game. ~ Developer docs
Thanks to Eddy Verbruggen for providing nativescript-taptic-engine as this continues its evolution by streamlining the API and adding Android support, inspired by react-native-haptic-feedback.
npm install @nativescript/haptics
Find an example of @nativescript/haptics usage here on StackBlitz.
The plugin provides the API below.
isHapticsSupported: boolean = Haptics.isSupported()
Checks if haptics is supported on the device.
import { Haptics } from "@nativescript/haptics";
Haptics.selection();
import { Haptics, HapticNotificationType } from "@nativescript/haptics";
Haptics.notification(HapticNotificationType.ERROR);
Use notification feedback generators to indicate success, failure, and warning.
Other haptic notification types are:
SUCCESS(default)WARNINGimport { Haptics, HapticImpactType } from "@nativescript/haptics";
Haptics.impact(HapticImpactType.HEAVY);
Use impact feedback generators to indicate that an impact has occurred. For example, you might trigger impact feedback when a user interface object collides with something or snaps into place.
There are 3 impact types:
LIGHTMEDIUM (default)HEAVY.To use the haptics fallbacks, check if there is support:
if (!Haptics.isSupported()) {
// use HapticsFallback
}
BEWARE This uses an undocumented feature that may get your app rejected when reviewed by Apple. People have used this approach without problems though.
This triggers the same effect as the 'Peek' in 'Peek & Pop', a very brief vibration.
import { HapticsFallback } from "@nativescript/haptics";
HapticsFallback.weakBoom();
import { HapticsFallback } from "@nativescript/haptics";
HapticsFallback.strongBoom();
This triggers the Pop effect of Peek & Pop, which is a bit more profound than the Peek effect.
import { HapticsFallback } from "@nativescript/haptics";
HapticsFallback.burst();
This triggers the Nope effect you get when force-touching a home icon that doesn't have any action. It's a short burst of 3-ish 'weak booms'.
Apache License Version 2.0
FAQs
Haptics for NativeScript
The npm package @nativescript/haptics receives a total of 178 weekly downloads. As such, @nativescript/haptics popularity was classified as not popular.
We found that @nativescript/haptics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.