4 Replies Latest reply: Feb 12, 2013 12:41 PM by pizmogames2 RSS

    Need to detect photo privacy setting on iOS 6 to avoid breakage.

    FLAdude Community Member

      iOS 6 has introduced a new privacy setting system that has users pick whether your app can access the camera roll. I tried catching an error when using addBitmapData to add to the camera roll, and that didn't work for detecting it. It also looks like that function returns void, so I can't check a return value for success. I need to do something like have a message to say this 'image cold not be stored to your photos because you have disabled photo access for this app'.

       

      How do you tell if the photo privacy setting is turned off?

        • 1. Re: Need to detect photo privacy setting on iOS 6 to avoid breakage.
          Colin Holgate CommunityMVP

          I haven't tried saving a photo yet, but when reading a photo you get the dialog asking permission to access the photo album. So, do you need to worry? If you go ahead and save the image, doesn't the user automatically get a dialog asking for permission?

          • 2. Re: Need to detect photo privacy setting on iOS 6 to avoid breakage.
            FLAdude Community Member

            Yes, we need to worry.

             

            Reading a photo is fine, it has a thing that comes up that says you need to give it permission whenever you attempt to access the user's photos, but writing a photo is horribly broken. The very first time your app attempts to save an image to the camera roll, and ONLY the very first time, it will have a thing that asks if you would like to let the app access your photos.

             

            After that, if they pick no, or for some reason somebody has gone into the settings and turned the permission off for your app, it will silently fail forever after. It would leave you with an unacceptable non-user-friendly nightmare scenerio where they think they are saving their stuff but it is actually not. They will get mad when they look at their photos later and find that all of the stuff they 'saved' is missing and say that your app is broken and does not save stuff or that it deleted their stuff.

             

            Who would even think about approving an app with such sloppy, unpolished, user infuriating potential?

            • 3. Re: Need to detect photo privacy setting on iOS 6 to avoid breakage.
              FLAdude Community Member

              Update: I have figured out that you can detect success or failure of the addBitmapData due to permissions by attaching an ErrorEvent.ERROR listener to the CameraRoll and an Event.COMPLETE for success. It apparently is asynchronous which is why catching an error with try/catch wouldn't work and it can't be checked with a return value.

              • 4. Re: Need to detect photo privacy setting on iOS 6 to avoid breakage.
                pizmogames2 Community Member

                Note that if the user has said NO to permitting access to photos previously, and they try to save, you can message them on ErrorEvent.ERROR to go to Privacy > Photos > NameofYourApp to re-enable it.