title: iOS app build with Adobe AIR SDK 24 crashes when trying to use permissions
body: <p>I have an adobe AIR app developed for iOS devices and I use Adobe Flash Builder 4.7 to create the .ipa file. </p>
  
  <p>Up to version 23 of the AIR SDK the app was working fine. With version 24 of the AIR SDK a Permissions class was added when trying to access the device camera. And now one should programmatically handle the permissions when accessing the camera as follows: <a href="https://forums.adobe.com/thread/2250328" rel="nofollow noreferrer">https://forums.adobe.com/thread/2250328</a></p>
  
  <p>I have tried implementing the given example in my codebase, and in the following snippet, I have null references to the permissions as follows:</p>
  
  <pre><code>   private function connect():void {      
          if (Camera.permissionStatus/*permissionStatus is null*/ != PermissionStatus.GRANTED)
          {       
                    cam.addEventListener(PermissionEvent.PERMISSION_STATUS,
                      function(e:PermissionEvent):void {
                          if (e.status == PermissionStatus.GRANTED) {
                              connectCamera();
                          } else {
                              // permission denied
                          }
                      });
  
                  try {
                      cam.requestPermission(); // **when calling this one my app crashes**
                  } catch(e:Error) {
                      // another request is in progress
                  }
           } else {
                connectCamera();
           }
      }
  
      private function connectCamera():void
      {
          video = new Video(640, 480);
          video.attachCamera(cam);
          addChild(video);
      }
  </code></pre>
  
  <p>My hunch is that when debugging on the device the Flash Builder is using the flex sdk instead of the AIR SDK which makes the aforementioned properties/methods unavailable as stated in the SDK documentation: <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html" rel="nofollow noreferrer">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html</a> where one can see that the permissionStatus method is only available for the AIR runtime.</p>
  
  <p>Therefore, how can I check and make sure that I am debugging using the AIR runtime and eventually avoid my app to crash when asking the user for camera permissions.</p>