VuframeLab / PanicAR

Augmented Reality Framework for iOS – PanicAR will be sunset April 30th, 2017
http://panicar.vuframe.com
207 stars 61 forks source link

Crash when camera permission is set to off #28

Closed leearmstrong closed 8 years ago

leearmstrong commented 10 years ago

We get a crash within the PanicAR code when opening a view when the iPhone has the camera permission for the app set to off.

The crash happens in the PARViewController in viewDidAppear at startCameraPreview

leearmstrong commented 10 years ago

This is the crash log too...

Application Specific Information: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* Can't add a nil AVCaptureInput'

Last Exception Backtrace: 0 CoreFoundation 0x0000000182996950 __exceptionPreprocess + 132 1 libobjc.A.dylib 0x000000018ee9c1fc objc_exception_throw + 56 2 AVFoundation 0x000000018168ad64 -[AVCaptureSession _addInputWithNoConnections:] + 912 3 AVFoundation 0x000000018168a364 -[AVCaptureSession addInput:] + 112 4 My App 0x0000000100426234 -PARViewController(Private) startCameraPreview 5 My App 0x0000000100424d08 -PARViewController(Private) startAR 6 My App 0x0000000100422ff0 -PARViewController viewDidAppear: 7 My App 0x000000010015c6d8 -PINKARViewController viewDidAppear:

leearmstrong commented 10 years ago

What is the ETA for this? If not for a while I will put a workaround in place.

azeitler commented 10 years ago

We are looking into it. The fix is pretty easy but we need to confirm first. If you have a workaround up and running, please use it. One of our developers will update this as things move along.

leearmstrong commented 10 years ago

Thanks Andreas, No we didn't have time for a workaround in the end so having to put up with the crashes. We didn't really want to instantiate AVFoundation in the core part of our app to do the checking

Miiha commented 10 years ago

We just updated the framework (build 3025), which should now handle the missing permissions correctly.

leearmstrong commented 10 years ago

Perfect thanks, we'll get that added to our beta testing track