I have a web view, that contains a file input to upload files.
I I click the file input we get a crash.
Source type must be UIImagePickerControllerSourceTypeCamera
"4 libobjc.A.dylib 0x0000000106ea8a97 _ZL15_objc_terminatev + 91",
"5 Aktionsfinder 0x0000000101644656 _ZL19CLSTerminateHandlerv + 355",
"6 libc++abi.dylib 0x000000010a5d165e _ZSt11__terminatePFvvE + 8",
"7 libc++abi.dylib 0x000000010a5d16d3 _ZSt9terminatev + 51",
"8 libdispatch.dylib 0x000000010a6dc55f _dispatch_client_callout + 28"
So I tried to find the problem and realized, that the crash only happens, when there is a capture="camera" attribute on the tag.
You can quickly try it yourselves by loading the following page in webview and clicking the "capture image" input and then selecting "Photo library", when you get the selector:
https://mobilehtml5.org/ts/?id=23
As soon as I remove the "capture" everything works fine.
Would that help: https://stackoverflow.com/a/48466875/4022333 ?
@Titozzz I've found the problem yersterday and it was a mistake on my part.
I did not add the camera permission entry to Info.plist:
So to make it work, just add an Info.plist entry for camera usage:
<key>NSCameraUsageDescription</key>
<string>You can take photos to document your job.</string>
Thanks
Most helpful comment
@Titozzz I've found the problem yersterday and it was a mistake on my part.
I did not add the camera permission entry to Info.plist:
So to make it work, just add an Info.plist entry for camera usage: