5 Commits
3 changed files with 10 additions and 5 deletions
+6 -1
View File
@@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.barcodescanner" id="com.phonegap.plugins.barcodescanner"
version="0.2.0"> version="0.3.0">
<name>BarcodeScanner</name> <name>BarcodeScanner</name>
@@ -12,6 +12,11 @@
<platform name="ios"> <platform name="ios">
<plugins-plist key="BarcodeScanner" string="CDVBarcodeScanner" /> <plugins-plist key="BarcodeScanner" string="CDVBarcodeScanner" />
<!-- Cordova >= 2.3 -->
<config-file target="config.xml" parent="/cordova/plugins">
<plugin name="BarcodeScanner" value="CDVBarcodeScanner"/>
</config-file>
<resource-file src="scannerOverlay.xib" /> <resource-file src="scannerOverlay.xib" />
<header-file src="zxing-all-in-one.h" /> <header-file src="zxing-all-in-one.h" />
@@ -121,7 +121,7 @@ public class BarcodeScanner extends Plugin {
//Log.d(LOG_TAG, "This should never happen"); //Log.d(LOG_TAG, "This should never happen");
} }
this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback); this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
} if (resultCode == Activity.RESULT_CANCELED) { } else if (resultCode == Activity.RESULT_CANCELED) {
JSONObject obj = new JSONObject(); JSONObject obj = new JSONObject();
try { try {
obj.put(TEXT, ""); obj.put(TEXT, "");
+3 -3
View File
@@ -300,7 +300,7 @@ parentViewController:(UIViewController*)parentViewController
- (NSString*)setUpCaptureSession { - (NSString*)setUpCaptureSession {
NSError* error = nil; NSError* error = nil;
AVCaptureSession* captureSession = [[AVCaptureSession alloc] init]; AVCaptureSession* captureSession = [[[AVCaptureSession alloc] init] autorelease];
self.captureSession = captureSession; self.captureSession = captureSession;
AVCaptureDevice* device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; AVCaptureDevice* device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
@@ -826,12 +826,12 @@ parentViewController:(UIViewController*)parentViewController
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{ {
return UIInterfaceOrientationLandscapeRight; return UIInterfaceOrientationPortrait;
} }
- (NSUInteger)supportedInterfaceOrientations - (NSUInteger)supportedInterfaceOrientations
{ {
return UIInterfaceOrientationMaskLandscape; return UIInterfaceOrientationMaskPortrait;
} }
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation