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 10.1.1 - decidePolicyForNavigationAction - Error when calling cloudSky.zBar.scan #97

Closed
harish441 opened this issue Nov 21, 2016 · 6 comments

Comments

@harish441
Copy link

Hello,

I am new to Cordova iOS development. In one of my application, I started using csZBar and works charmingly until I updated my iOS to 10.1.1. After the update, on clicking the method cloudSky.zBar.scan, I am getting the below error:

WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: *** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 1]

Request you all to help me in fix this issue and make the plugin compatible with new iOS update.

Thanks
Harish Kalla

@harish441 harish441 changed the title iOS 10.1.1 - Error when calling cloudSky.zBar.scan iOS 10.1.1 - decidePolicyForNavigationAction - Error when calling cloudSky.zBar.scan Nov 21, 2016
@dcousens
Copy link
Contributor

#70

@harish441
Copy link
Author

Fixed the issue in CsZBar.m by applying the below changes as suggested in http://stackoverflow.com/questions/16353491/how-to-hide-info-button-in-zbar-bar-code-reader-for-ios6-0-and-above/16353530#16353530 by Kiko:

float currentVersion = 5.1;
float sysVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
UIView * infoButton;

if (sysVersion > currentVersion && sysVersion < 10 )
infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:3];
else
infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:1];

[infoButton setHidden:YES];

@dcousens
Copy link
Contributor

Hi @harish441, as pointed out in #70, if you just use the latest code in this repository (not what is released on npm), it already has the fix necessary.

Cheers

@harish441
Copy link
Author

@dcousens: Thanks for the update. I retrieved the latest code in the repository and it's working pretty good.

@harish441
Copy link
Author

@dcousens , @tjwoon : One question, may be weird. As I am new to GitHub, I don't know where to place this request.

Are you guys planning to have iOS development to be done in Swift in near future?

@dcousens
Copy link
Contributor

@harish441 this module isn't in active development, mostly just maintenance. So I'd say it would be safe to say that Swift isn't in scope at this time.

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