Start a new topic
Solved

capture screen error in iOS

Hi, I'm trying to implement capture screen in my app and when I tap the button to call the function it throws an exception and freezes the app. The debugger says the error is in this line (please see screenshot attached):


 WTScreenshotCaptureMode captureMode = [[command.arguments objectAtIndex:0] boolValue] ? WTScreenshotCaptureMode_CamAndWebView : WTScreenshotCaptureMode_Cam;


please note that I'm using the cordova plugin sdk version 5.3. I'm testing in an iPhone 7 using iSO 11.4.1, I haven't tested in Android yet but apart from the screen capture everything else is working fine. Thanks for your attention!




Good morning Axel,



would you mind catching the exception and checking what the associated error message is. That should make it much easier to identify the problem.


@try
{
    // the offending line of code
}
@catch (NSException *exception)
{
    NSLog(@"%@", exception.reason);
}



- Daniel

Hi again,



random guess: did you perhaps forget to add the Privacy - Photo Library Usage Description and Privacy - Photo Library Additions Usage Description entries to your Info.plist file?



- Daniel



Hi, thanks for your messages. I’m going to try to catch the exception and post it here. I did put a photo library usage description but not the photo addition so I’ try that too, Best Regards

Hi Daniel, here are some updates. I added the  Privacy - Photo Library Additions Usage Description that was missing and it still didn't work. I tested the app on Android and the capture screen did work. I put the code in the try catch block and the error it gives is:


2018-08-23 18:01:12.236724-0400 D7AR[20115:2244298] -[NSNull boolValue]: unrecognized selector sent to instance 0x1b62d3878


As you can see in the image attached it happens every time the captureScreen function is called, any ideas? Thanks for your help


Hi, I found out what the error was. The plugin call to the captureScreen function was incorrect, thanks it was this.wikitudePlugin.captureScreen(truenull, this.onCapturedScreen, this.onErrorCaptureScreen); when it should be this.wikitudePlugin.captureScreen(this.onCapturedScreen, this.onErrorCaptureScreen, true, null); Thanks for your attention anyway!

 

 

Login or Signup to post a comment