ns plugin add @ticnat/nativescript-socketmobile
- 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
- initialize the scanner with the callbacks:
socket.didReceiveDecodedData = (data: string, device, result) => {
console.log('scannedText', data);
}
socket.initScanner();
-
Connect and pair your sockermobile scanner with the iPad through socket mobile companion app
-
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>
- All done!
Notice:
-
This plugin tested on Socket mobile S740 model but I think it works with other models.
-
The plugin is under development, if you have any improvements Welcome to PRs!
Apache License Version 2.0