Highlighted

Trying to access the iOS 11Camera Roll on AIR 28+ results in a blank screen

Participant ,
Mar 13, 2018

Copy link to clipboard

Copied

I have an old app that I was asked to update. The app contains the ability to attach a photo to a form, either via the Camera or Camera Roll. I updated to AIR 28 as part of making sure Apple would even accept it and added in the new permission checks (the last build was in AIR 22). The camera functionality works perfectly and the Camera Roll works on Android, but on iOS the Camera Roll is just blank:

IMG_929614376848-1.jpeg

Here is a snippet of code I am using to authorize usage (file usage is requested earlier on):

private function launchCamera(e:NativeDialogEvent):void {

    if ( e.index == "0" ) {

        if (CameraRoll.supportsBrowseForImage) {

            if (CameraRoll.permissionStatus != PermissionStatus.GRANTED) {

                var roll:CameraRoll = new CameraRoll();

                roll.addEventListener(PermissionEvent.PERMISSION_STATUS, function (e:PermissionEvent):void {

                    if (e.status == PermissionStatus.GRANTED) {

                        launchCameraRoll();

                    } else {

                        Alerter.showAlert("To use this functionality, you must provide permission to access the Camera Roll");

                    }

                });

               

                try {

                    roll.requestPermission();

                } catch (e:Error) {

                    // another request is in progress

                }

            } else {

                launchCameraRoll();

            }

        }

    } else if ( e.index == "1" ) {

        if (CameraUI.isSupported) {

            if (CameraUI.permissionStatus != PermissionStatus.GRANTED) {

                var cam:CameraUI = new CameraUI();

                cam.addEventListener(PermissionEvent.PERMISSION_STATUS, function (e:PermissionEvent):void {

                    if (e.status == PermissionStatus.GRANTED) {

                        launchCameraUI();

                    } else {

                        Alerter.showAlert("To use this functionality, you must provide permission to access the Camera");

                    }

                });

               

                try {

                    cam.requestPermission();

                } catch (e:Error) {

                    // another request is in progress

                }

            } else {

                launchCameraUI();

            }

        }

    }

}

/**

* Launches the camera roll. Meant to be called after permissions are requested

*/

private function launchCameraRoll():void {

    var roll:CameraRoll = new CameraRoll();

    roll.addEventListener(MediaEvent.SELECT, this.camCompleteHandler);

    roll.browseForImage();

}

private function launchCameraUI():void {

    var cam:CameraUI = new CameraUI();

    cam.addEventListener(MediaEvent.COMPLETE, this.camCompleteHandler);

    cam.launch(MediaType.IMAGE);

}

And here is the iPhone node in my app.xml:

    <iPhone>

        <InfoAdditions><![CDATA[

<key>UIDeviceFamily</key>

<array>

<string>1</string>

</array>

<key>NSAppTransportSecurity</key>

<dict>

  <key>NSAllowsArbitraryLoads</key>

  <true/>

</dict>

            <key>NSPhotoLibraryAddUsageDescription</key>

                <string>Used for selecting Photos from your device to include in Service submissions.</string>

            <key>NSPhotoLibraryUsageDescription</key>

                <string>Used for selecting Photos from your device to include in Service submissions.</string>

            <key>NSCameraUsageDescription</key>

                <string>Used for taking new photos to include in Service submissions.</string>

]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

I double checked older builds and they work just fine. I've tested on the latest releases for AIR 27 and 28, plus the AIR 29 beta and they all have the same issue. I am able to replicate it both in debug mode and in an ad hoc distribution package. I see nothing in the Xcode Logs and nothing shows up in the console when debugging either. Anyone how to resolve this? It's the final thing holding this update up from release.

TOPICS
Development

Views

1.2K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Trying to access the iOS 11Camera Roll on AIR 28+ results in a blank screen

Participant ,
Mar 13, 2018

Copy link to clipboard

Copied

I have an old app that I was asked to update. The app contains the ability to attach a photo to a form, either via the Camera or Camera Roll. I updated to AIR 28 as part of making sure Apple would even accept it and added in the new permission checks (the last build was in AIR 22). The camera functionality works perfectly and the Camera Roll works on Android, but on iOS the Camera Roll is just blank:

IMG_929614376848-1.jpeg

Here is a snippet of code I am using to authorize usage (file usage is requested earlier on):

private function launchCamera(e:NativeDialogEvent):void {

    if ( e.index == "0" ) {

        if (CameraRoll.supportsBrowseForImage) {

            if (CameraRoll.permissionStatus != PermissionStatus.GRANTED) {

                var roll:CameraRoll = new CameraRoll();

                roll.addEventListener(PermissionEvent.PERMISSION_STATUS, function (e:PermissionEvent):void {

                    if (e.status == PermissionStatus.GRANTED) {

                        launchCameraRoll();

                    } else {

                        Alerter.showAlert("To use this functionality, you must provide permission to access the Camera Roll");

                    }

                });

               

                try {

                    roll.requestPermission();

                } catch (e:Error) {

                    // another request is in progress

                }

            } else {

                launchCameraRoll();

            }

        }

    } else if ( e.index == "1" ) {

        if (CameraUI.isSupported) {

            if (CameraUI.permissionStatus != PermissionStatus.GRANTED) {

                var cam:CameraUI = new CameraUI();

                cam.addEventListener(PermissionEvent.PERMISSION_STATUS, function (e:PermissionEvent):void {

                    if (e.status == PermissionStatus.GRANTED) {

                        launchCameraUI();

                    } else {

                        Alerter.showAlert("To use this functionality, you must provide permission to access the Camera");

                    }

                });

               

                try {

                    cam.requestPermission();

                } catch (e:Error) {

                    // another request is in progress

                }

            } else {

                launchCameraUI();

            }

        }

    }

}

/**

* Launches the camera roll. Meant to be called after permissions are requested

*/

private function launchCameraRoll():void {

    var roll:CameraRoll = new CameraRoll();

    roll.addEventListener(MediaEvent.SELECT, this.camCompleteHandler);

    roll.browseForImage();

}

private function launchCameraUI():void {

    var cam:CameraUI = new CameraUI();

    cam.addEventListener(MediaEvent.COMPLETE, this.camCompleteHandler);

    cam.launch(MediaType.IMAGE);

}

And here is the iPhone node in my app.xml:

    <iPhone>

        <InfoAdditions><![CDATA[

<key>UIDeviceFamily</key>

<array>

<string>1</string>

</array>

<key>NSAppTransportSecurity</key>

<dict>

  <key>NSAllowsArbitraryLoads</key>

  <true/>

</dict>

            <key>NSPhotoLibraryAddUsageDescription</key>

                <string>Used for selecting Photos from your device to include in Service submissions.</string>

            <key>NSPhotoLibraryUsageDescription</key>

                <string>Used for selecting Photos from your device to include in Service submissions.</string>

            <key>NSCameraUsageDescription</key>

                <string>Used for taking new photos to include in Service submissions.</string>

]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

I double checked older builds and they work just fine. I've tested on the latest releases for AIR 27 and 28, plus the AIR 29 beta and they all have the same issue. I am able to replicate it both in debug mode and in an ad hoc distribution package. I see nothing in the Xcode Logs and nothing shows up in the console when debugging either. Anyone how to resolve this? It's the final thing holding this update up from release.

TOPICS
Development

Views

1.2K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 13, 2018 0
Participant ,
Mar 15, 2018

Copy link to clipboard

Copied

Hi there. I've just tried my app that uses the CameraRoll with AIR29 and it seems to open the Camera roll and show images fine on an iPhone running iOS 11.3.

So, just to clarify, you tap in your app to launch the camera roll functionality, then you see the Apple Permission request window, accept it and then the CameraRoll slides in and it is just empty without any title/images or even a Cancel button? I'd normally expect it to appear with a title (Photos) an a Cancel and then show all the images/directories.

Or does the CameraRoll not even appear (in which case are you somehow requesting permission twice and falling into the // another request is in progress)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 15, 2018 0
Participant ,
Mar 15, 2018

Copy link to clipboard

Copied

The former. I request permission, grant it, open the camera roll, and the camera roll is 100% empty like you see above. No title, no buttons, no images.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 15, 2018 0
Participant ,
Mar 19, 2018

Copy link to clipboard

Copied

While trying to figure this out, I have created a simple test application that is just a button and the code posted in the original post and it results in the broken camera roll as well. I have additionally tested both applications on multiple other devices and have seen the same results.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 19, 2018 0
Participant ,
Mar 19, 2018

Copy link to clipboard

Copied

It's probably worth adding a bug at Tracker​ (if you haven't already). You can upload a file with your test application code/config to help investigation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 19, 2018 0
Participant ,
Mar 19, 2018

Copy link to clipboard

Copied

I attempted to but every time I try submitting that form, it results in a "Bug Submission Failed" error with nothing more descriptive and a 400 Response with this very descriptive content '{"key":null,"status":"BAD_REQUEST"}'. So it looks like that form is broken.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 19, 2018 0
Participant ,
Mar 19, 2018

Copy link to clipboard

Copied

Not great. It may be worth raising the problem here then AIR Beta Channel . Also if you look at this post 3/13/2018 - Release - Flash Player 29 there are some contact details that may be useful.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 19, 2018 0
Community Beginner ,
Mar 20, 2018

Copy link to clipboard

Copied

Hi,

Thanks for reporting the issue. We are not able to reproduce this issue at our end using your code snippet. Could you please share some additional details like steps, device information or sample project to reproduce this issue.

Thanks,

Amit Baliyan | Adobe AIR Engineering

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 1
Participant ,
Mar 20, 2018

Copy link to clipboard

Copied

This is the test app I cobbled together to test this bug in isolation to rule out it being other code in my app. I tested it this morning with a fresh install of Flex 4.13 and AIR 29 (using the Flex Installer application) and the same problems are still present.

Dropbox - camroll.zip

I have additionally created a screen recording of what I see when I run the app (it's in debug mode, but the same issues occur after a full compile). Dropbox - camera-roll-adobe-air29-problem.MP4

Here is what I tried posting yesterday to the bug tracker but ran into errors posting. If you need any further information, please let me know.

Problem Description:

An AIR 29/Flex 4.13 app running on iOS 11 is unable to access the Camera Roll. It will work once, at most, immediately after requesting permission. Any further attempts result in the camera roll being briefly seen before the entire page being emptied (even the menubar is empty). When this occurs, the only way to proceed is to force close the app and restart it.

This does not occur on Android and there do not appear to be any issues with the Camera. I have additionally tested it on AIR 27 and 28.

Steps to Reproduce:

1. Request permission to access Camera Roll

2. Give permission to access Camera Roll

3. Open Camera Roll

4. User may be able to access the Camera Roll at this point. This is intermittent, however, and I have been unable to figure out when it is possible

5. Attempt to access the Camera Roll again

Actual Result:

Camera roll appears for a few frames and then all content is removed, including menubar content, resulting in a blank screen that cannot progress any further without a full app restart.

Expected Result:

Camera roll opens and user either selects a photo or cancels

Any Workarounds:

It generally works the first time after requesting permission, but fails on any further attempts

Hardware Info:

Tested on iPhone 6S, iPad Mini 2, iPad 3rd Gen, iPad Air 2, and on various devices in the iOS Simulator

Operating System:

Compiled on macOS 10.13.3 (High Sierra) using IntelliJ IDEA 2017.3, Adobe AIR 27-29, and Flex 13.

Occurs on iOS 11. Have not tested previous iOS releases

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 0
Community Beginner ,
Mar 21, 2018

Copy link to clipboard

Copied

Hi,

Thanks for providing the information. We have tried your sample project with Flash Builder 4.7 on iOS 11 and camera roll is opening fine. Could you please try with Flash Builder and let us know if it works for you.

Thanks,

Amit Baliyan | Adobe AIR Engineering

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 21, 2018 0
Participant ,
Mar 21, 2018

Copy link to clipboard

Copied

I actually switched from using Flash Builder to IntelliJ because it crashes when building iOS apps or trying to configure build settings for iOS on High Sierra. You can't possibly recommend using software you no longer support (I haven't seen an update in probably 5 or 6 years now) that crashes on modern operating systems as a solution to a problem where it seems your SDK doesn't work with modern operating systems.

That said, because that is the only solution to my issues that I have seen so far, I did some searching and found a patch that does manage to allow me to build via Flash Builder again (see this post). Unfortunately after making the patch, I saw no improvement. Indeed, neither app even prompts me for permission to open the camera roll any more and the camera roll functionality is completely broken.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 21, 2018 0
Community Beginner ,
Mar 22, 2018

Copy link to clipboard

Copied

Hi,

We are not able to reproduce this issue at our end. Below are the steps which we are following:

1. Install Flash Builder on Mac 10.13 (High Sierra)
2. Run the Flash Builder using java 7 or 8
3. Replace the jars at the location “/Applications/Adobe Flash Builder 4.7/eclipse/plugins/”
4. Restart Flash Builder
5. Import the project shared by you
6. Run the project on iOS 11 device

Steps to Run the Flash Builder using java 7 (Step 2) and jars to replace (Step 3) are placed at (http://blogs.adobe.com/flashplayer/2018/02/running-adobe-flash-builder-on-mac-with-java-78 .html)

Please use latest Flex SDK 29 from https://www.adobe.com/devnet/air/air-sdk-download.html and let us know if it works for you.

Thanks,

Amit Baliyan | Adobe AIR Engineering

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 22, 2018 0