Phonegap-plugin-barcodescanner: Interactive dismissal in iOS 13

Created on 27 Aug 2019  Â·  14Comments  Â·  Source: phonegap/phonegap-plugin-barcodescanner

Expected Behaviour

Slide down to fully close the modal.

Actual Behaviour

The modal dissapears but the process remains active.
If the modal is closed using the slide action, you cannot open for the second time.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Open the modal and slide down.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 13

Plugin version

phonegap-plugin-barcodescanner 8.1.1-dev "BarcodeScanner"

Most helpful comment

The issue appears when the app is builded with xCode 11.
Here is the fix: https://github.com/vlinde/phonegap-plugin-barcodescanner/commit/2d5bb2e417a78df9bd1ca91aeeefd36aa5e42cee

All 14 comments

The issue appears when the app is builded with xCode 11.
Here is the fix: https://github.com/vlinde/phonegap-plugin-barcodescanner/commit/2d5bb2e417a78df9bd1ca91aeeefd36aa5e42cee

@vlinde DId you open a pull request for that change?

@brandonhudson Doesn't look like one was created. I can confirm that the fix from @vlinde works - it disables the ability to swipe the modal.

Awesome, thanks!

I think the code need to be updated, I’ll check today.
This condition if (@available(iOS 13.0, *)) need to be changed to work an all devices with iOS 13. You can try to replace 13.0 with 13.

On 9 Oct 2019, at 02:47, Adrián Peña notifications@github.com wrote:

So basically you must edit the .mm in the plugins/barcodescanner/src/ios/CDVBarcodeScanner.mm and that's all?

I feel like I'm missing something, I already raw pasted the whole corrected .mm and still will allow iOS 13 users to swipe the modal out.

I think the code need to be updated, I’ll check today. This condition if (@available(iOS 13.0, *)) need to be changed to work an all devices with iOS 13. You can try to replace 13.0 with 13.
…
On 9 Oct 2019, at 02:47, Adrián Peña @.*> wrote: So basically you must edit the .mm in the plugins/barcodescanner/src/ios/CDVBarcodeScanner.mm and that's all? I feel like I'm missing something, I already raw pasted the whole corrected .mm and still will allow iOS 13 users to swipe the modal out.

It was my bad, for some reason I got 2 different CDVBarcodeScanner.mm, I changed both and it worked.
Not sure why I have both but... now it works!
Thanks alot!

Could you be more precise on how to fix this problem ?
I changed both files CDVBarcodeScanner.mm (in xcode project and in the ionic project) according to @vlinde's fix but I still have the hability to swipe down the scanner.

I have also the problem about the process still running when I click the cancel button which makes me impossible to re launch the scanner a second time.

@eshope-repo There is an alternative solution to this problem. If fullscreen is not an issue with you, the default screen mode can be opened as PresentationFullscreen like this: https://github.com/nakhadon/phonegap-plugin-barcodescanner/commit/1332ba06d99307ae9383da1835113c39b7ce870a. The screen is then opened as fullscreen and a swipe down to close the camera is not possible.

If this is a viable solution and fullscreen is not an issue for everyone, I can start a PR.

Any Updates on this?
Aka when will this be integrated/fixed?
We're facing the problem simply when trying to scan a second time which can happen a lot in our app so this is breaking the whole functionality for us.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@nakhadon Thank you! Please merge the fix!

Hi, i found a solution to display the scanner in full screen and not in modal (pending official correction)

In the CDVBarcodeScanner.mm file (cordova-plugin-barcodescanner)

1/ Find & Replace openDialog function (in Xcode)
2/ Re-build app & try

- (void)openDialog { [self.viewController setModalPresentationStyle:UIModalPresentationFullScreen]; [self.parentViewController presentViewController:self.viewController animated: NO completion:nil]; }

I hope you help

Guess someone created a pull request #869

There are many pull requests but no committer is approving or rejecting it and thats unfortunate. This will force many of us to move away from this plugin if it is not maintained

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luckylooke picture luckylooke  Â·  6Comments

camilonos77 picture camilonos77  Â·  7Comments

vespino picture vespino  Â·  9Comments

brunovinny picture brunovinny  Â·  6Comments

thomas-tran picture thomas-tran  Â·  9Comments