@ticnat/nativescript-socketmobile
by ticnat | v1.0.2
NativeScript plugin for integrating SocketMobile scanners
npm i --save @ticnat/nativescript-socketmobile

@ticnat/nativescript-socketmobile

ns plugin add @ticnat/nativescript-socketmobile

Usage

  1. create a new instance of the scanner plugin:
const socket = new Socketmobile(AppKey,DeveloperID, AppID);

and pass you appkey developerId and appId obtained from Socket Mobile Developer Portal

  1. initialize the scanner with the callbacks:
socket.didReceiveDecodedData = (data: string, device, result) => {
console.log('scannedText', data);
}
socket.initScanner();
  1. Connect and pair your sockermobile scanner with the iPad through socket mobile companion app

  2. add these to info.plist file

<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.socketmobile.chs</string>
</array>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Using bluetooth to connect the app to the barcode scanner</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Using bluetooth to connect the app to the barcode scanner</string>
  1. All done!

Notice:

  1. This plugin tested on Socket mobile S740 model but I think it works with other models.

  2. The plugin is under development, if you have any improvements Welcome to PRs!

License

Apache License Version 2.0