1

I'm looking to STOP Phonegap from saving pictures to the camera roll on iOS.

I've discovered one possible solution, but I don't really like it. The solution requires forking the phonegap API by deleting this line of code.

UIImageWriteToSavedPhotosAlbum(img, self, 
              @selector(image:didFinishSavingWithError:contextInfo:), nil);

from the capture.m file in the phonegaplib folder (and then rebuilding the phonegaplib.xproj of course).

Anybody have a better solution?

1 Answer 1

3

Just use the camera API instead of the capture API. It allows you to specify whether or not you will be saving to the camera roll. http://docs.phonegap.com/en/1.3.0/phonegap_camera_camera.md.html#Camera

options = { limit: 1, "savePhotoToAlbum" : "false" };

Options is one of the parameters you can pass to the getPicture function. It takes an object like the above. The important parameter is the "savePhotoToAlbum". Setting that to false will prevent it from saving it.

2
  • I don't see savePhotoToAlbum anywhere in the PhoneGap API documentation. Also, limit is in the Capture API, not the Camera API. In fact, I'm having the opposite problem where it does not save to the camera roll when my destination type is FILE_URI.
    – Yoh Suzuki
    Feb 10, 2012 at 22:32
  • 1
    I see. It's saveToPhotoAlbum, not savePhotoToAlbum.
    – Yoh Suzuki
    Feb 14, 2012 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.