SocketMobile / swift-package-capturesdk

CaptureSDK is the easiest solution for adding barcode scanning and RFID/NFC reading capability to an iOS application
Other
6 stars 1 forks source link

Disabling SocketCam C820 still calls didNotifyArrivalForDevice #13

Open chbeer opened 1 year ago

chbeer commented 1 year ago

I disabled the SocketCam C820 as described here: https://docs.socketmobile.com/capture/ios/en/latest/socketCam.html#enabling-socketcam

I just call it with .disable, but I get E_INVALIDHANDLE, then the SocketCam still reported with didNotifyArrivalForDevice

cyrille-socket commented 1 year ago

Hi @chbeer,

ok I'll look into it.

In the meantime you can filter out the SocketCam device that arrives with

if deviceInfo.deviceType == .socketCamC820 { return }

Best, Cyrille

yliu342 commented 11 months ago

Hi, Any update on this? We are also facing the same issue. We didn't setup SocketCam and it seems to be automatically added and received with the didNotifyArrivalForDevice method.

It only happens on the latest 1.8.34

yliu342 commented 11 months ago

When we call the getDevices() the . socketCamC820 is always returned. We will have to manually filter it out..

cyrille-socket commented 11 months ago

Hi @yliu342

the version 1.8.51 of our Swift Package on our private git repository also fixes this issue of having SocketCam device in your list.

yliu342 commented 10 months ago

Hi @cyrille-socket

I'm using the latest 1.8.53 there is a new entry you need to add to LSApplicationQueriesSchemes which is not mentioned anywhere in the doc.

Also the C820 is still showing if there are no other socket scanner is connect. If there is a connected socket scanner then C820 is not showing.

cyrille-socket commented 10 months ago

Hi @yliu342

If you're using the 1.8.53, it means that you got the CaptureSDK on our private repository. Indeed, it has been removed from the Readme. It will be reinserted in the next release. Here's the part:

You also need to add the following key to your Info.plist: LSApplicationQueriesSchemes (Queried URL Schemes) with a new item: sktcompanion (in lower case).

So as of the 1.8.53, CaptureSDK enables by default SocketCam so if you don't have a physical scanner, you still can scan a barcode out of the box. So normally if you have a physical scanner connected, you should have it still unless you disabled it.

Can you share the code of your didNotifyArrivalForDevice please?

yliu342 commented 10 months ago

Hi @cyrille-socket we don't do anything special in didNotifyArrivalForDevice basically every time didNotifyArrivalForDevice get called we make a call to getDevices() and update a list of connected devices. The C820 is always returned from the the getDevices() function.

I also tried to set before calling openWithAppInfo

socketAPI.setSocketCamStatus(.disable) { result in
            print("\(result)")
        }

And the result is always E_INVALIDHANDLE

yliu342 commented 10 months ago

Also since your company moved to the private repo in future how should we get support or open issues such like this?

cyrille-socket commented 10 months ago

Hi @cyrille-socket we don't do anything special in didNotifyArrivalForDevice basically every time didNotifyArrivalForDevice get called we make a call to getDevices() and update a list of connected devices. The C820 is always returned from the the getDevices() function.

I also tried to set before calling openWithAppInfo

socketAPI.setSocketCamStatus(.disable) { result in
            print("\(result)")
        }

And the result is always E_INVALIDHANDLE

openWithAppInfo needs to be called in the first place along when you launch your app basically. Then ou can call any set/get property.

cyrille-socket commented 10 months ago

Also since your company moved to the private repo in future how should we get support or open issues such like this?

You can write to our developers support email: developers@socketmobile.com

Ceroce commented 6 days ago

As of version 1.9.74.0, we're still notified of the C820 arriving, even though it was not explicitly enabled.

I had updated the SDK, and I did not understand why my code was always notified that a scanner was arriving, even though it was not turned on. It took me too long to understand that this was not my scanner (S700), but the C820.

cyrille-socket commented 1 day ago

Hi @Ceroce , the device arrival of SocketCam C820 is normal as it is enabled by default in our CaptureSDK. If you don't use camera scanning, you can do the following:

if deviceInfo.deviceType == .socketCamC820 || deviceInfo.deviceType == .socketCamC860 { 
        // do something or don't do something 
}

or disable SocketCam with our CaptureHelper:

let captureHelper = CaptureHelper.sharedInstance
captureHelper.setSocketCamStatus(.disable, withCompletionHandler: { (setResult) in
        if setResult == SKTCaptureErrors.E_NOERROR {
                print("SocketCam disabled returned \(setResult.rawValue)")
        }
})