• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Unable to set iOS camera permissions with AIR SDK 24

New Here ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

As the air sdk 24 was released, it introduced the permissions API. Currently I have an app that targets the iOS platform and when it tries to access the camera, it fails with Error #3800: This call requires Camera permission.

I have tried to follow the example provided in the SDK release notes (12/13/2016 - Release - AIR 24 Runtime and SDK but when calling cam.requestPermission(); as outlined in the example, the app is crashing silently and the debugger doesn't show any error.

I am using Adobe Flash Builder 4.7 with AirSDK 24 installed and the target device is an iPad AIR with iOS 10.1.

One note though is that I have tried debugging the following properties/method calls:

Camera.permissionStatus

cam.requestPermission();

and in my console result both undefined, even though in Flash Builder it clearly shows that I am using AIR SDK 24 and also the xml app descriptor also is using version 24, is it possible that the IDE in debug mode is using another SDK version?

My fear is that the Flex SDK 4.6 that I am using in the IDE is replacing the AIR SDK and that is why the new methods/properties are not available, I have tried overlaying the Flex SDK with the AIR SDK but the IDE is complaining about that and it seems I cannot overlay Flex SDK 4.6 with AIR SDK 24.

Any thoughts on how can I be sure that I am debugging my app using the AIR SDK 24 with the Flash Builder 4.7 and also request camera permissions from the user?



TOPICS
Development

Views

6.0K

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
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jan 17, 2017 Jan 17, 2017

Hi Xqstilo,

Kindly include cocoa keys under <infoAdditions> tag in app.xml

For Example, If you are trying to access the Camera in your application, you need to include below tag under <infoAdditions>

<key>NSCameraUsageDescription</key>

<string>"SOME TEXT"</string>

Please refer to below link for detailed information on cocoa keys:

Cocoa Keys

Thanks,

Adobe AIR Team

Votes

Translate

Translate
Adobe Employee ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Hi Xqstilo,

Kindly include cocoa keys under <infoAdditions> tag in app.xml

For Example, If you are trying to access the Camera in your application, you need to include below tag under <infoAdditions>

<key>NSCameraUsageDescription</key>

<string>"SOME TEXT"</string>

Please refer to below link for detailed information on cocoa keys:

Cocoa Keys

Thanks,

Adobe AIR Team

Votes

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
community guidelines
New Here ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

Hello Deesharm,

Thanks very much for the hints, in my xml config I was adding the key under the Entitlements tag, how is the infoAdditions different from that, and btw it works now

Votes

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
community guidelines
Community Beginner ,
Dec 18, 2017 Dec 18, 2017

Copy link to clipboard

Copied

Hello,

I've added the mentioned tags in my app.xml

The app works correctly, that is the user is prompted a message requesting to allow the use of the camera. And then it works.

Neverthless my last attempt to publish the app (using Air 27) in ITunes was rejected by Apple Team with the following motivation:

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage

We noticed that your app requests the user’s consent to access the camera but does not clarify the use of this feature in the permission modal alert.

They also attached a screenshot taken from my app. Here it is:

attachment-8472780383014822870Screenshot-1214-162510.png

So, it seems that even if I specified the NSCameraUsageDescription tag, the message is not shown in the popup.

This cause my app to be rejected by Apple team.

Here is how my app.xml looks like

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<application xmlns="http://ns.adobe.com/air/application/20.0">

  ...

  <initialWindow>

    ...

  </initialWindow>

  <icon>

    ...

  </icon>

  <iPhone>

    <requestedDisplayResolution>high</requestedDisplayResolution>

    <InfoAdditions>

        <key>NSCameraUsageDescription</key>

        <string>Take photos to players, coach and team, in order to produce more engaging reports</string>

<![CDATA[

... other stuff ...

]]>

    </InfoAdditions>

  </iPhone>

  <extensions>

    ...

  </extensions>

</application>

What is the problem?

Thank you in advance

Votes

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
community guidelines
Engaged ,
Dec 18, 2017 Dec 18, 2017

Copy link to clipboard

Copied

why are you using AIR namespace 20.0? Shouldn't it be 27.0 for AIR SDK 27? Also, the camera roll/camera permissions were added in AIR 24, IIRC

Votes

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
community guidelines
Community Beginner ,
Dec 18, 2017 Dec 18, 2017

Copy link to clipboard

Copied

mmmhh... you are right!

I forgot to update that reference.

Ok I'll try to publish again the app in ITunes after modifing the xmlns.

I'll inform you about the result.

Thank you!

Votes

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
community guidelines
New Here ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

I have the same problem in Adobe Animate building IOS app in test mode. SKD 28.0.0.125

While updating an older application. Camera permissions dialog does not pop up. Additionally in settings on the iPhone under my app, there are no options to enable Camera Use. What could be the problem? I added the NSCameraUsageDescription and others to the xml file, please see below.

I attempted severa times, I deleted the app and recompiled it and installed via USB. Allow camera pop-up does not show. Checking the code in the debugger I get: PermissionError: 'Error #3800: This call requires CameraUI permission. in this line cCameraUI.launch(MediaType.IMAGE); after passes camera support test.

Applications XML below:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<application xmlns="http://ns.adobe.com/air/application/28.0">

    <id>com.AppXYZ.service</id>

    <versionNumber>1.5.4</versionNumber>

    <filename>AppXYZ It</filename>

    <description></description>

    <!-- To localize the description, use the following format for the description element.

  <description>

  <text xml:lang="en">English App description goes here</text>

  <text xml:lang="fr">French App description goes here</text>

  <text xml:lang="ja">Japanese App description goes here</text>

  </description>

  -->

    <name>AppXYZ It</name>

    <!-- To localize the name, use the following format for the name element.

  <name>

  <text xml:lang="en">English App name goes here</text>

  <text xml:lang="fr">French App name goes here</text>

  <text xml:lang="ja">Japanese App name goes here</text>

  </name>

  -->

    <copyright></copyright>

    <initialWindow>

        <content>AppXYZRealCustomerAppIOS002.swf</content>

        <systemChrome>standard</systemChrome>

        <transparent>false</transparent>

        <visible>true</visible>

        <fullScreen>true</fullScreen>

        <autoOrients>false</autoOrients>

        <aspectRatio>portrait</aspectRatio>

        <renderMode>auto</renderMode>

    </initialWindow>

    <customUpdateUI>false</customUpdateUI>

    <allowBrowserInvocation>false</allowBrowserInvocation>

    <icon>

        <image29x29>IOS%20ICONS/AppXYZ%20Logo-29x29.png</image29x29>

        <image57x57>IOS%20ICONS/AppXYZ%20Logo-57x57.png</image57x57>

        <image114x114>IOS%20ICONS/AppXYZ%20Logo-114x114.png</image114x114>

        <image512x512>IOS%20ICONS/AppXYZ%20Logo-512x512.png</image512x512>

        <image48x48>IOS%20ICONS/AppXYZ%20Logo-48x48.png</image48x48>

        <image72x72>IOS%20ICONS/AppXYZ%20Logo-72x72.png</image72x72>

        <image50x50>IOS%20ICONS/AppXYZ%20Logo-50x50.png</image50x50>

        <image58x58>IOS%20ICONS/AppXYZ%20Logo-58x58.png</image58x58>

        <image100x100>IOS%20ICONS/AppXYZ%20Logo-100x100.png</image100x100>

        <image144x144>IOS%20ICONS/AppXYZ%20Logo-144x144.png</image144x144>

        <image1024x1024>IOS%20ICONS/AppXYZ%20Logo-1024x1024.png</image1024x1024>

        <image40x40>IOS%20ICONS/AppXYZ%20Logo-40x40.png</image40x40>

        <image76x76>IOS%20ICONS/AppXYZ%20Logo-76x76.png</image76x76>

        <image80x80>IOS%20ICONS/AppXYZ%20Logo-80x80.png</image80x80>

        <image120x120>IOS%20ICONS/AppXYZ%20Logo-120x120.png</image120x120>

        <image75x75>IOS%20ICONS/AppXYZ%20Logo-75x75.png</image75x75>

        <image60x60>IOS%20ICONS/AppXYZ%20Logo-60x60.png</image60x60>

        <image87x87>IOS%20ICONS/AppXYZ%20Logo-87x87.png</image87x87>

        <image167x167>IOS%20ICONS/AppXYZ%20Logo-167x167.png</image167x167>

        <image152x152>152.png</image152x152>

        <image180x180>180.png</image180x180>

    </icon>

    <iPhone>

        <requestedDisplayResolution>high</requestedDisplayResolution>

        <InfoAdditions><![CDATA[

  <key>NSCameraUsageDescription</key>

        <string>Take and upload a picture of the items to transport.</string>

  <key>NSPhotoLibraryUsageDescription</key>

        <string>Upload a picture of the items to transport from the photo library.</string>

  <key>NSPhotoLibraryAddUsageDescription</key>

        <string>Write a picture of the items to transport from the photo library.</string>

  <key>UIDeviceFamily</key>

     <array><string>1</string><string>2</string></array>

]]></InfoAdditions>

    </iPhone>

</application>

Votes

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
community guidelines
New Here ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

Just a thought it could be related to NSPhotoLibraryAddUsageDescription.

If I open the plist in Xcode I don't see the private in front of it. Notice in the image it does not say Privacy -

Plist.png

Votes

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
community guidelines
Adobe Employee ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hi,

With AIR 24 and above you need to call requestPermission() on the camera object. Refer section "Permissions on Android and iOS" in AIR 24 release notes for more details.

Thanks,

Krati | Adobe AIR Engineering

Votes

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
community guidelines
New Here ,
Mar 12, 2018 Mar 12, 2018

Copy link to clipboard

Copied

Yes that resolved the problem. Jumping from SDK 20 to 28 did not realize that apart from the privacy keys, there was a new requirement to include: requestPermission().

For those with similar problems and you skipped SDK 24. Do this:

1) Check your code. If you have not been using requestPermission() include it.

2) add the privacy keys a shown above

Thanks,

Votes

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
community guidelines
New Here ,
Jun 21, 2018 Jun 21, 2018

Copy link to clipboard

Copied

Hi brothers.

I have some problems with iOS building... i need to take screenshot of my stage and save in camera roll or native photo gallery.

In Android version, works fine, but in iOS, simply don´t work. How can i solve this?

my XML>

<application xmlns="http://ns.adobe.com/air/application/29.0">

  <id>com.lz.AraucoBrasil</id>

  <versionNumber>3.3.8</versionNumber>

  <filename>Arauco Brasil</filename>

  <description/>

  <name>Arauco Brasil</name>

  <copyright/>

  <initialWindow>

    <content>AraucoBrasil.swf</content>

    <systemChrome>standard</systemChrome>

    <transparent>false</transparent>

    <visible>true</visible>

    <fullScreen>true</fullScreen>

    <aspectRatio>landscape</aspectRatio>

    <renderMode>auto</renderMode>

    <autoOrients>false</autoOrients></initialWindow>

  <icon>

    <image29x29>icons/IconeApp%2029.png</image29x29>

    <image57x57>icons/IconeApp%2057.png</image57x57>

    <image114x114>icons/IconeApp%20114.png</image114x114>

    <image512x512>icons/IconeApp512.png</image512x512>

    <image48x48>icons/IconeApp%2048.png</image48x48>

    <image72x72>icons/IconeApp%2072.png</image72x72>

    <image50x50>icons/IconeApp%2050.png</image50x50>

    <image58x58>icons/IconeApp%2058.png</image58x58>

    <image100x100>icons/IconeApp%20100.png</image100x100>

    <image144x144>icons/IconeApp%20144.png</image144x144>

    <image1024x1024>icons/IconeApp%201024.png</image1024x1024>

    <image40x40>icons/IconeApp%2040.png</image40x40>

    <image76x76>icons/IconeApp%2076.png</image76x76>

    <image80x80>icons/IconeApp%2080.png</image80x80>

    <image120x120>icons/IconeApp%20120.png</image120x120>

    <image152x152>icons/IconeApp%20152.png</image152x152>

    <image180x180>icons/IconeApp%20180.png</image180x180>

    <image60x60>icons/IconeApp%2060.png</image60x60>

    <image75x75>icons/IconeApp%2075.png</image75x75>

    <image87x87>icons/IconeApp%2087.png</image87x87>

    <image167x167>icons/IconeApp%20167.png</image167x167>

  </icon>

  <customUpdateUI>false</customUpdateUI>

  <allowBrowserInvocation>false</allowBrowserInvocation>

 

  <supportedLanguages>pt</supportedLanguages>

  <iPhone>

    <InfoAdditions><![CDATA[

  <key>NSCameraUsageDescription</key>

  <string>Take and upload a picture of the items to transport.</string>

  <key>NSPhotoLibraryUsageDescription</key>

  <string>Upload a picture of the items to transport from the photo library.</string>

  <key>NSPhotoLibraryAddUsageDescription</key>

  <string>Write a picture of the items to transport from the photo library.</string>

  <key>UIDeviceFamily</key>

  <array>

    <string>1</string>

  </array>

]]></InfoAdditions>

    <requestedDisplayResolution>high</requestedDisplayResolution>

  </iPhone>

 

  </application>

thanks !!!1

Votes

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
community guidelines
Enthusiast ,
Jun 21, 2018 Jun 21, 2018

Copy link to clipboard

Copied

LATEST

Hi. In your code, are you using PermissionEvent and checking the CameraRoll.permissionStatus?

Votes

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
community guidelines