From 7a8c1188b2e9a6a248932b3ed36a1f9a2baebfb3 Mon Sep 17 00:00:00 2001 From: parveshneedhoo Date: Mon, 18 Mar 2024 17:21:55 +0400 Subject: [PATCH] return result after switching camera --- src/ios/SimpleCameraPreview.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ios/SimpleCameraPreview.m b/src/ios/SimpleCameraPreview.m index efd5bcf..757a0d4 100644 --- a/src/ios/SimpleCameraPreview.m +++ b/src/ios/SimpleCameraPreview.m @@ -158,10 +158,11 @@ - (void) torchSwitch:(CDVInvokedUrlCommand*)command{ - (void) switchToUltraWideCamera:(CDVInvokedUrlCommand*)command{ NSString *device = [command.arguments objectAtIndex:0]; + BOOL cameraSwitched = FALSE; if (self.sessionManager != nil) { - [self.sessionManager switchToUltraWideCamera: device]; + cameraSwitched = [self.sessionManager switchToUltraWideCamera: device]; } - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:cameraSwitched]; [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; }