3 Replies Latest reply on Apr 29, 2016 2:55 PM by kerrishotts

    saveToPhotoAlbum alternative?


      I have a few older apps that have been in use for a long time. They are phonegap build version 3.7 apps.


      I notice a problem with my app's running in new android phones (5.0+ or maybe even 4.4+), works fine in older android and all iOS, in that if I have saveToPhotoAlbum: true in my getPicture function, it breaks the entire function. Here is my function:


          function takePicture() {         navigator.camera.getPicture(             function(uri) {               //do success stuff                        },             function(e) {                 //do error stuff             },            { quality: 50, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType : navigator.camera.PictureSourceType.CAMERA, saveToPhotoAlbum: true})     }

      Anyone know why this breaks in newer android phones and what an alternative might be? Soon as I remove saveToPhotoAlbum everything works fine.





      PS - sorry it took my preformated function and put it all one one line

        • 1. Re: saveToPhotoAlbum alternative?
          kerrishotts Adobe Employee

          What exactly do you mean by "break"? Are there errors logged to the JavaScript or device console (adb logcat)? That might help diagnose or pinpoint the problem.


          I'm wondering if It might be a permissions issue. If so, I think the device console should indicate that.

          • 2. Re: saveToPhotoAlbum alternative?
            kens3732779 Level 1

            The function no longer triggers the success or error functions. No javascript errors that I can see, no console log messages triggered, It just does nothing when you push the button. Works fine in all of my other assortment of phones, just with the new android is this happening.  I checked through permissions and the App has all permissions turned on.

            • 3. Re: saveToPhotoAlbum alternative?
              kerrishotts Adobe Employee

              You mentioned that these were 3.7 PG Build apps -- I'd suggest:


              - Upgrade to PG Build CLI 6 (you can do this in your config.xml)

              - Make sure that the plugin you are using is up-to-date.


              Before attempting it with your app, I'd suggest doing something very simple just so you can verify that the plugin works as expected, and then make the necessary changes to your app (since the move from 3.7 to 6 will probably need code changes on your part).