BlinkID / blinkid-ios

Everything you need to add AI-driven ID scanning into your native iOS app.
https://microblink.com/products/blinkid
384 stars 89 forks source link

Camera crash #167

Closed luanpv87 closed 6 years ago

luanpv87 commented 6 years ago

I'm trying run this command [self.containerViewController resumeScanningAndResetState:YES]; and I see crash with Log Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Camera session should be started and running to resume recognition' *** First throw call stack: (0x1853ded8c 0x1845985ec 0x1853debf8 0x185dcefa0 0x10129a530 0x1004666ec 0x18f03a6d8 0x18f03a448 0x1012e2630 0x18f03a448 0x18f2f846c 0x18f067ac8 0x18f067720 0x18f05b424 0x18efb3770 0x18955525c 0x1895593ec 0x1894c5aa0 0x1894ed5d0 0x1894ee450 0x185386910 0x185384238 0x185384884 0x1852a4da8 0x187287020 0x18f28578c 0x1004a1788 0x184d35fc0) libc++abi.dylib: terminating with uncaught exception of type NSException

dgust6 commented 6 years ago

Hi @luanpv87 ,

It seems like you are calling [self.containerViewController resumeScanningAndResetState:YES]; while camera is not shown on the screen. The camera has to be active to resume scanning activity.

For your use-case of changing the settings we recommend:

  1. Pausing scanning while camera is still active. Be sure to pause scanning and not the camera https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/Headers/PPScanningViewController.h#L62-L69

  2. Changing settings to add PPMrtdRecognizer and remove driver's license recognizer: https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/Headers/PPCoordinator.h#L33-L34

  3. Applying settings changes: https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/Headers/PPCoordinator.h#L61-L67

  4. Resuming scanning activity: https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/Headers/PPScanningViewController.h#L71-L86

culoi commented 6 years ago

Closing the issue. Please reopen if you have additional question or contact us directly at support@microblink.com