Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
#13 Cordova-iOS 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Sep 7, 2015
1 parent 009175b commit de5700c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/ios/CDVBarcodeScanner.mm
Expand Up @@ -183,23 +183,17 @@ - (void)returnSuccess:(NSString*)scannedText format:(NSString*)format cancelled:
resultWithStatus: CDVCommandStatus_OK
messageAsDictionary: resultDict
];

NSString* js = [result toSuccessCallbackString:callback];
if (!flipped) {
[self writeJavascript:js];
}
[self.commandDelegate sendPluginResult:result callbackId:callback];
}

//--------------------------------------------------------------------------
- (void)returnError:(NSString*)message callback:(NSString*)callback {
CDVPluginResult* result = [CDVPluginResult
resultWithStatus: CDVCommandStatus_OK
resultWithStatus: CDVCommandStatus_ERROR
messageAsString: message
];

NSString* js = [result toErrorCallbackString:callback];

[self writeJavascript:js];
[self.commandDelegate sendPluginResult:result callbackId:callback];
}

@end
Expand Down Expand Up @@ -277,16 +271,16 @@ - (void)scanBarcode {
//--------------------------------------------------------------------------
- (void)openDialog {
[self.parentViewController
presentModalViewController:self.viewController
animated:YES
presentViewController:self.viewController
animated:YES completion:nil
];
}

//--------------------------------------------------------------------------
- (void)barcodeScanDone {
self.capturing = NO;
[self.captureSession stopRunning];
[self.parentViewController dismissModalViewControllerAnimated: YES];
[self.parentViewController dismissViewControllerAnimated: YES completion:nil];

// viewcontroller holding onto a reference to us, release them so they
// will release us
Expand Down

0 comments on commit de5700c

Please sign in to comment.