{"id":15305148,"url":"https://github.com/eddyverbruggen/nativescript-taptic-engine","last_synced_at":"2025-04-15T00:29:52.044Z","repository":{"id":57308784,"uuid":"67712696","full_name":"EddyVerbruggen/nativescript-taptic-engine","owner":"EddyVerbruggen","description":":vibration_mode: Use Apple's Taptic Engine to vibrate your iPhone 6s (and up) in a variety of ways","archived":false,"fork":false,"pushed_at":"2021-09-14T08:39:25.000Z","size":4245,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T18:05:46.245Z","etag":null,"topics":["feedback","haptic","nativescript","nativescript-plugin","taptic-engine"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-08T14:54:26.000Z","updated_at":"2025-04-01T14:02:13.000Z","dependencies_parsed_at":"2022-08-29T12:51:08.875Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-taptic-engine","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-taptic-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-taptic-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-taptic-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-taptic-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-taptic-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248983687,"owners_count":21193623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feedback","haptic","nativescript","nativescript-plugin","taptic-engine"],"created_at":"2024-10-01T07:59:23.797Z","updated_at":"2025-04-15T00:29:52.026Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"Vue","readme":"# NativeScript Taptic Engine plugin\n\n[![Build Status][build-status]][build-url]\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[build-status]:https://travis-ci.org/EddyVerbruggen/nativescript-taptic-engine.svg?branch=master\n[build-url]:https://travis-ci.org/EddyVerbruggen/nativescript-taptic-engine\n[npm-image]:http://img.shields.io/npm/v/nativescript-taptic-engine.svg\n[npm-url]:https://npmjs.org/package/nativescript-taptic-engine\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-taptic-engine.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/nativescript-taptic-engine/master/media/taptic-6s-plus.jpg\" width=\"541px\" height=\"350px\"/\u003e\n\n## Supported platforms\n* Official API: iPhone 7 / 7 Plus or newer\n* Unofficial API: iPhone 6s / 6s Plus or newer\n* Requires Xcode 8 to build\n\n## Installation\nFrom the command prompt go to your app's root folder and execute:\n\n```\ntns plugin add nativescript-taptic-engine\n```\n\n## Demo app (NativeScript Core, XML)\nWant to dive in quickly? Check out [the demo app](demo)! Otherwise, continue reading.\n\nYou can run the demo app from the root of the project by typing `npm run demo.ios.device` and you'll see this:\n\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/nativescript-taptic-engine/master/media/demo-app.png\" width=\"375px\"/\u003e\n\n## Demo app (NativeScript-Vue)\nWe also have a Vue demo! Check out [the demo-vue app](demo-vue)!\n\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/nativescript-taptic-engine/master/media/demo-vue-app.png\" width=\"375px\"/\u003e\n\nTo run it locally:\n\n```bash\ngit clone https://github.com/EddyVerbruggen/nativescript-taptic-engine\ncd nativescript-taptic-engine/src\nnpm run demo-vue.ios\n```\n\n## Using Angular?\nThere's nothing that prevents you from using Angular. Just copy the examples in the Vue or Core demo (or the snippets below).\n\n## Official API (requires at least iPhone 7)\nIt's recommended to use this API, but you're limited to iPhone 7 and higher.\nAs per [Apples guidelines](https://developer.apple.com/reference/uikit/uifeedbackgenerator)\nthere's no runtime way to determine if the device is capable of providing haptic feedback,\nso the Promise can largely be ignored so I'm not even showing them here.\n\nThe API names are modeled after what [Apple has called them](https://developer.apple.com/reference/uikit/uifeedbackgenerator):\n\n### `selection`\nUse selection feedback generators to indicate a change in selection.\n\n##### TypeScript\n```js\n// require the plugin\nimport {TapticEngine} from \"nativescript-taptic-engine\";\n\n// instantiate the plugin\nlet tapticEngine = new TapticEngine();\n\ntapticEngine.selection();\n```\n\n##### JavaScript\n```js\n// require the plugin\nvar TapticEngine = require(\"nativescript-taptic-engine\").TapticEngine;\n\n// instantiate the plugin\nvar tapticEngine = new TapticEngine();\n\ntapticEngine.selection();\n```\n\n### `notification`\nUse notification feedback generators to indicate successes, failures, and warnings.\n\nThere are 3 notification types: `TapticEngineNotificationType.SUCCESS` (default), `.WARNING`, and `.ERROR`.\n\n##### TypeScript\n```js\n// require the plugin\nimport {TapticEngine, TapticEngineNotificationType} from \"nativescript-taptic-engine\";\n\n// instantiate the plugin\nlet tapticEngine = new TapticEngine();\n\ntapticEngine.notification({\n  type: TapticEngineNotificationType.ERROR\n});\n```\n\n### `impact`\nUse impact feedback generators to indicate that an impact has occurred.\nFor example, you might trigger impact feedback when a user interface object\ncollides with something or snaps into place.\n\nThere are 3 impact styles: `TapticEngineImpactStyle.LIGHT`, `.MEDIUM` (default), and `.HEAVY`.\n\n##### TypeScript\n```js\n// require the plugin\nimport {TapticEngine, TapticEngineImpactStyle} from \"nativescript-taptic-engine\";\n\n// instantiate the plugin\nlet tapticEngine = new TapticEngine();\n\ntapticEngine.impact({\n  type: TapticEngineImpactStyle.HEAVY\n});\n```\n\n\n## Unofficial API (requires at least iPhone 6s)\n__BEWARE__ This uses an undocumented feature which may get your app rejected when reviewed by Apple.\n[People have used this approach __without problems__ though.](http://stackoverflow.com/questions/32526868/taptic-in-ios-9)\n\n### `weakBoom`\nThis triggers the same effect as the 'Peek' in 'Peek \u0026 Pop', a very brief vibration.\n\n##### TypeScript\n```js\n// require the plugin\nimport {TapticEngineUnofficial} from \"nativescript-taptic-engine\";\n\n// instantiate the plugin\nlet tapticEngineUnofficial = new TapticEngineUnofficial();\n\ntapticEngineUnofficial.weakBoom().then(() =\u003e {\n  // note that unsupported iOS devices like the simulator also end up here\n}, (err) =\u003e {\n  console.log(\"You're running on Android. Meh.\");\n});\n```\n\n##### JavaScript\n```js\n// require the plugin\nvar TapticEngineUnofficial = require(\"nativescript-taptic-engine\").TapticEngineUnofficial;\n\n// instantiate the plugin\nvar tapticEngineUnofficial = new TapticEngineUnofficial();\n\ntapticEngineUnofficial.weakBoom().then(\n  function() {\n    // note that unsupported iOS devices like the simulator also end up here\n    console.log(\"Boomed weakly, if available.\");\n  }, function () {\n    console.log(\"You're running on Android. Meh.\");\n  }\n);\n```\n\n### `strongBoom`\nThis triggers the 'Pop' effect of 'Peek \u0026 Pop', which is a bit more profound than the 'Peek' effect.\n\nCodewise this is exactly the same as `weakBoom`, except for the function name of course.\n\n\n### `burst`\nThis triggers the 'Nope' effect you get when fi. force touching a home icon which doesn't have any action. It's a short burst of 3-ish 'weak booms'.\n\nCodewise this is exactly the same as `weakBoom` and `strongBoom`, except for the function name of course.\n\n## Changelog\n* 2.1.0  Modernized the code a little, migrated to the plugin seed structure, and added a Vue demo.\n* 2.0.0  Added official API for iPhone 7. Moved the old API to TapticEngineUnofficial.*. Requires Xcode 8 to build.\n* 1.0.0  Initial release, unofficial API only. Compatible with any Xcode version.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-taptic-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-taptic-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-taptic-engine/lists"}