Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS issue #47

Closed
digvijayLogistic opened this issue Dec 14, 2022 · 10 comments
Closed

iOS issue #47

digvijayLogistic opened this issue Dec 14, 2022 · 10 comments

Comments

@digvijayLogistic
Copy link

I have working on IONIC project and i have stucked at one point of scanner issue.
Can you please once look with this demo and please help me on this issue.

DEMO CODE: https://www.dropbox.com/s/h23268kr9bdalhv/qr-code-dynamosoft.zip?dl=0

ISSUE:

I have created one scanner.js file which contains scanner methods like createInstance, startScanner and stopScanner.
And two different pages are created "Test Page 1" & "Test Page 2"

So first we open scanner from anyone of the page from above and scanner works (WITH OPEN CAMERA VIEW)
But if we go to another page and then open scanner then it's not works fine. There is CAMERA VIEW is not open but scanning of barcode is works.

So basically if you first go to the "Test Page 1" and start scanner then works fine (OPEN CAMERA VIEW and Barcode scans perfectly) then you go to the another page "Test Page 2" and start scanner then it's not works like "NOT OPEN CAMERA VIEW but scanning of barcode is works without open CAMERA VIEW".

Can you please help me on this what was the issue on this ??? I really needs help on this please ....

Steps for generate IOS build:

  • npm i
  • ionic cordova prepare ios
  • Open ios project to XCODE and run it on device
@Dynamsoft-Henry
Copy link
Collaborator

Thanks for messaging us. The bug is fixed and a beta version is now available on the 'develop' branch.
It takes some time to release a new version. Would you like to try the code on develop branch first?

@digvijayLogistic
Copy link
Author

Yea sure, i will try and let you know.

Thank you so much

@digvijayLogistic
Copy link
Author

Hello @Dynamsoft-Henry

Develop branch is works fine for me, but one another is is happened and it's also happened on master branch.

There is green box is some time is not closes, when we change one page from another, Can you please help on this if you have any idea on this ??

@Dynamsoft-Henry
Copy link
Collaborator

Dynamsoft-Henry commented Dec 20, 2022

Hello @digvijayLogistic
For some reason, DCVCameraEnhancer is designed as a singleton. As a result, you are using the same DCVCameraEnhancer instance in your "Test Page 1" and "Test Page 2". I think the "green box" you mean is the scan region that set by DCVCameraEnhancer. You can disable the scan region setting by triggering dce.setScanRegion(null) in your code.

If you want to set the scan region in "Test Page 1" but don't set it in "Test Page 2". You can add the following code in your text page 1.js:

// Add an event - onVisibilityChange
document.addEventListener('visibilitychange', onVisibilityChange, false);
// Implement onVisibilityChange
function onVisibilityChange(e) {
if (document.visibilityState === 'hidden') {
dce.close()
dbr.stopScanning()
// Disable the scan region when the page is hidden.
dce.setScanRegion(null)
} else if (document.visibilityState === 'visible') {
dce.open()
dbr.startScanning()
}
}

@digvijayLogistic
Copy link
Author

Thank you so much, but i think it's not working for me.

And i have investigated more on plugin and i found one method for show/hide region : setScanRegionVisible()
So now i have used this method for show/hide region and it's works for me.

@digvijayLogistic
Copy link
Author

digvijayLogistic commented Jan 2, 2023

Hey @Dynamsoft-Henry

Happy New Year 🎊🎊

I am not sure if it is barcode specific or if it stops after a period of time. Here are a couple examples where I can't get them to scan.

Are there settings we can adjust?

Here is a barcode images:

![16718502692571671849130694](https://user-images.githubusercontent.com/46132367/210201575-d14d5fba-c701-4408-bece

16718504996851671849361109
-d749dd464d8b.jpeg)

@digvijayLogistic
Copy link
Author

16718502692571671849130694

@Dynamsoft-Henry
Copy link
Collaborator

@digvijayLogistic Hello. Happy new year!
git-cordova-upca
The barcodes on your photo are too blurry and I think that the reason why they are not decoded.
I think these two barcodes are UPCA. I generated the above image and they are can be decoded by the library.
If your usage scenario is to decode barcodes from the video streaming, the best way to decode them is to get closer to the barcodes.

We do have barcode scan settings to improve the readability of the library. You can update the settings via the method updateRuntimeSettings.
You can try to get higher readability with the preset template VIDEO_READ_RATE_FIRST or IMAGE_READ_RATE_FIRST with the following code:

dcvBarcodeReader.updateRuntimeSettings(Dynamsoft.EnumDBRPresetTemplate.VIDEO_READ_RATE_FIRST)

or

dcvBarcodeReader.updateRuntimeSettings(Dynamsoft.EnumDBRPresetTemplate.IMAGE_READ_RATE_FIRST)

If it still not work, would you like to send us a short video as well as some sample image to show us how you want to scan the barcodes? Then we can give you a customized template to improve the performance.

support@dynamsoft.com is our support email. If necessary, you can send us images or video throw this email to get better support.

@digvijayLogistic
Copy link
Author

Yes sure, Thank you so much !!

@digvijayLogistic
Copy link
Author

digvijayLogistic commented Jan 24, 2023

Hello @Dynamsoft-Henry

There is new issue happened on IOS devices.

When i was testing, if i open scanner first time then it's work fine to show green-box (scan region)
And if i open it second time green-box (scan-region) not appears but it scans properly, but as per user experience it's not looks good.

I'm using this plugins "develop" branch.

So basically i needs green-box always when we open scanner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants