views:

69

answers:

2

HI i am using zxing API into my application and it says that the application cannot be posted to the App Store because it is using private or undocumented APIs:

Private Symbol References UIGetScreenImage

can somebody help me out as soon as possible

A: 

ZXing is displaying the feed from the camera live on the screen, and using UIGetScreenImage to repeatedly capture the resulting image without the user having to do anything. (This is a very nice user experience because the user doesn't have to press a button to take a picture of the barcode; the app just keeps taking pictures over and over until it gets one that works.)

This technique used to be perfectly fine, but Apple has recently changed their policy and banned the use of UIGetScreenImage. In light of Apple's change in policy, your best choice now is to make it so the user has to press a button to photograph the barcode manually.

Since ZXing is open-source, this should be a simple matter of changing a few lines of code to now use [UIImagePickerController takePicture].

Jon Rodriguez
+1  A: 

ZXing 1.6, which was released yesterday, has switched to the AV Foundation classes of iOS 4. It's the real-time scanning approach that's allowed by Apple.

Update:

ZXing 1.6 comes with three iPhone projects:

  • Barcodes is the original iPhone app. It's still using the UIGetScreenImage API.
  • ZXingWidget is a library that you can include into your own app. It uses the new AV Foundation classes.
  • ScanTest is a sample app using ZXingWidget

So the way to go is to use the ZXingWidget.

Codo
i downloaded that new version but it still uses the UIGetScreenImage to get the image and this is what is rejectint the app ..is there any other solution .
mrugen
Strange. I had a look at the latest development version a few days ago, and the code was there (even though I didn't run it). Just search for _AVCaptureSession_ in the source code. For real-time scanning (as opposed to taking a picture and then scanning it), the AV Foundation classes are the only solution.
Codo
I guess you tried the _Barcodes_ app. Try _ScanTest_ instead. See my update of the answer.
Codo
yes i integrated the Barcodes app and then i changed to scannerkit sdk which is really good and worked for me well .. again thanks for your inputs..
mrugen