Scanning QR codes
NativeScript has support for plugins. A plugin can add extra functionality, such as turning on the flash light of a phone, vibrating the phone, logging in with Facebook, or scanning QR codes. These can be installed using the command line interface of NativeScript.
We will use a NativeScript plugin to scan QR codes. The plugin is called NativeScript BarcodeScanner. It can scan QR codes and other barcode formats. The plugin can be installed using the following command:
tns plugin add nativescript-barcodescanner
Type definitions
We must add a definition file to import the plugin. The plugin does not contain type definitions, and type definitions are not available on DefinitelyTyped and TSD. It is not necessary to write definitions ...
Get TypeScript: Modern JavaScript Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.