Camera scanning with SocketCam

Support

The React Native CaptureSDK has support for both SocketCam C820 and C860.

Requirements

In order to use SocketCam in your React Native app, you will need to install or upgrade the React Native CaptureSDK to version 2.0 or higher.

iOS Requirements

Use pod install --repo-update to be updated of the latest version of iOS CaptureSDK.

In your Info.plist, you need to add the key to allow access to the camera. You also need to add the sktcompanion scheme to the LSApplicationQueriesSchemes array.

<key>NSCameraUsageDescription</key>
        <string>Need to enable camera access for SocketCam products such as C820</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>sktcompanion</string>
</array>

Android Requirements

In AndroidManifest.xml you will need to add the below code.

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.socketmobile.capture.APP_KEY" android:value="{YOUR_APP_KEY}"/>
<meta-data android:name="com.socketmobile.capture.DEVELOPER_ID" android:value="{YOUR_DEVELOPER_ID}"/>

Differentiating SocketCam from other devices

With CaptureHelper, the SocketCamTypes array is exported to help identify SocketCam devices:

import { SocketCamTypes } from 'react-native-capture';

// In onDeviceArrival callback
if (SocketCamTypes.indexOf(device.type) > -1) {
    // This is a SocketCam device (C820 or C860)
    setSocketCamDevice(device);
}

SocketCamTypes includes CaptureDeviceType.SocketCamC820 and CaptureDeviceType.SocketCamC860.