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

onSuccess called before camera activity closed #47

Closed
dcousens opened this issue Feb 16, 2016 · 4 comments
Closed

onSuccess called before camera activity closed #47

dcousens opened this issue Feb 16, 2016 · 4 comments

Comments

@dcousens
Copy link
Contributor

Having the camera view still running (while it is closing) AFTER the onSuccess callback is called means other plugins such as cordova-plugin-dialog won't work and have an internal violation.

This typically means I have to add a setTimeout(..., 1000) to my QR scanner to avoid the application from failing to re-open those plugins.

The simplest example of this would be (using cordova-plugin-dialog):

cloudSky.zBar.scan({}, function () {
  window.navigator.alert('This fails', function () {}, 'Text', 'OK')
}, functoin () {
  setTimeout(function () {
    window.navigator.alert('But this works... until you do the other one', function () {}, 'Text', 'OK')
  }, 1000)
})
uniphonic added a commit to uniphonic/csZBar that referenced this issue Feb 29, 2016
wait until viewController is dismissed before callback, fixes tjwoon#47
@MaicolBen
Copy link
Contributor

This doesn't work sometimes, I could avoid this issue removing the error callback

@dcousens
Copy link
Contributor Author

dcousens commented Apr 6, 2016

Interesting @MaicolBen, do you have any idea on how to fix it within the Android plugin code?

@dcousens
Copy link
Contributor Author

dcousens commented Apr 6, 2016

If not, do you have a reproduction test-case I could use to attempt to fix it for #48?

@MaicolBen
Copy link
Contributor

@dcousens Nevermind, I found that onError is called before the camera activity closed in iOS and Android, so it is quite similar, but it is more related to #42

dcousens added a commit that referenced this issue Apr 12, 2016
wait until viewController is dismissed before callback, fixes #47
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

2 participants