phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.42k forks source link

Interactive dismissal in iOS 13 #814

Open vlinde opened 5 years ago

vlinde commented 5 years ago

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"

vlinde commented 5 years ago

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

brandonhudson commented 5 years ago

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

whodeee commented 5 years ago

@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.

brandonhudson commented 5 years ago

Awesome, thanks!

vlinde commented 5 years ago

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.

Adrian-GP commented 5 years ago

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!

eshope-repo commented 5 years ago

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.

nakhadon commented 4 years ago

@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.

mobychan commented 4 years ago

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.

stale[bot] commented 4 years ago

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.

elvisgraho commented 4 years ago

@nakhadon Thank you! Please merge the fix!

Soryuk commented 4 years ago

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

WIStudent commented 4 years ago

Guess someone created a pull request #869

5r1m commented 4 years ago

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