CB-8706, CB-8707 saveToPhotoAlbum improvements and some refactoring

- On Windows we should use filePicker instead of programmatically
accessing user libs. This way the app doesnt have to depend on extra
capabilities.

- Some refactoring to help on navigating code easier

This closes #78
diff --git a/.travis.yml b/.travis.yml
index b741964..fa7ae7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,8 +6,8 @@
 install:
   - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config 
   - cd ..
-  - npm install -g purplecabbage/cordova-paramedic
+  - npm install -g cordova-paramedic
   - npm install -g cordova
   - npm install -g ios-sim
 script:
-  - cordova-paramedic --platform ios --plugin ../cordova-plugin-camera
\ No newline at end of file
+  - cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR}
diff --git a/README.md b/README.md
index c47d60f..8630bd0 100644
--- a/README.md
+++ b/README.md
@@ -94,6 +94,7 @@
 - Tizen
 - Windows Phone 7 and 8
 - Windows 8
+- Windows
 
 ### Preferences (iOS)
 
@@ -255,7 +256,8 @@
 
 - Any `cameraDirection` value results in a back-facing photo.
 
-- Ignores the `allowEdit` parameter.
+- Android also uses the Crop Activity for allowEdit, even though crop should work and actually pass the cropped image back to Cordova, the only one that works consistently is the one bundled 
+with the Google Plus Photos application.  Other crops may not work.
 
 - `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
 
diff --git a/doc/de/index.md b/doc/de/index.md
index b39a02e..1c7486c 100644
--- a/doc/de/index.md
+++ b/doc/de/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Dieses Plugin definiert eine globale `navigator.camera`-Objekt, das eine API für Aufnahmen und für die Auswahl der Bilder aus dem System-Image-Library bietet.
 
@@ -31,7 +31,7 @@
 
 ## Installation
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -431,4 +431,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/es/index.md b/doc/es/index.md
index 45e36e0..dfd0970 100644
--- a/doc/es/index.md
+++ b/doc/es/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Este plugin define un global `navigator.camera` objeto que proporciona una API para tomar fotografías y por elegir imágenes de biblioteca de imágenes del sistema.
 
@@ -29,7 +29,7 @@
 
 ## Instalación
 
-    Cordova plugin agregar org.apache.cordova.camera
+    Cordova plugin agregar cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -388,4 +388,4 @@
     
     function onSuccess() {console.log ("cámara limpieza éxito.")}
     
-    function onFail(message) {alert (' falló porque: ' + mensaje);}
\ No newline at end of file
+    function onFail(message) {alert (' falló porque: ' + mensaje);}
diff --git a/doc/fr/index.md b/doc/fr/index.md
index a7f1b53..ec005f0 100644
--- a/doc/fr/index.md
+++ b/doc/fr/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Ce plugin définit un global `navigator.camera` objet qui fournit une API pour la prise de photos et de choisir des images de la bibliothèque d'images du système.
 
@@ -29,7 +29,7 @@
 
 ## Installation
 
-    Cordova plugin ajouter org.apache.cordova.camera
+    Cordova plugin ajouter cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -388,4 +388,4 @@
     
     fonction onSuccess() {console.log ("succès de caméra nettoyage.")}
     
-    function onFail(message) {alert (' a échoué car: "+ message);}
\ No newline at end of file
+    function onFail(message) {alert (' a échoué car: "+ message);}
diff --git a/doc/it/index.md b/doc/it/index.md
index 140df67..da0b919 100644
--- a/doc/it/index.md
+++ b/doc/it/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Questo plugin definisce un oggetto globale `navigator.camera`, che fornisce un'API per scattare foto e per aver scelto immagini dalla libreria di immagini del sistema.
 
@@ -31,7 +31,7 @@
 
 ## Installazione
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -431,4 +431,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/ja/index.md b/doc/ja/index.md
index ec72906..5bdb3e1 100644
--- a/doc/ja/index.md
+++ b/doc/ja/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 このプラグインは、写真を撮るため、システムのイメージ ライブラリからイメージを選択するために API を提供します、グローバル `navigator.camera` オブジェクトを定義します。
 
@@ -31,7 +31,7 @@
 
 ## インストール
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -431,4 +431,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/ko/index.md b/doc/ko/index.md
index 16c69c3..794aa97 100644
--- a/doc/ko/index.md
+++ b/doc/ko/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 이 플러그인 시스템의 이미지 라이브러리에서 이미지를 선택 및 사진 촬영을 위한 API를 제공 하는 글로벌 `navigator.camera` 개체를 정의 합니다.
 
@@ -31,7 +31,7 @@
 
 ## 설치
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -431,4 +431,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/pl/index.md b/doc/pl/index.md
index 9727687..f226698 100644
--- a/doc/pl/index.md
+++ b/doc/pl/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Ten plugin definiuje obiekt globalny `navigator.camera`, który dostarcza API do robienia zdjęć i wybór zdjęć z biblioteki obrazów systemu.
 
@@ -31,7 +31,7 @@
 
 ## Instalacja
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -431,4 +431,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/ru/index.md b/doc/ru/index.md
index c7e5216..f93609c 100644
--- a/doc/ru/index.md
+++ b/doc/ru/index.md
@@ -17,11 +17,11 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 Этот плагин предоставляет API для съемки и для выбора изображения из библиотеки изображений системы.
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -414,4 +414,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/doc/zh/index.md b/doc/zh/index.md
index a23063b..ab719ab 100644
--- a/doc/zh/index.md
+++ b/doc/zh/index.md
@@ -17,7 +17,7 @@
     under the License.
 -->
 
-# org.apache.cordova.camera
+# cordova-plugin-camera
 
 這個外掛程式定義了一個全球 `navigator.camera` 物件,它提供了 API,拍照,從系統的圖像庫中選擇圖像。
 
@@ -31,7 +31,7 @@
 
 ## 安裝
 
-    cordova plugin add org.apache.cordova.camera
+    cordova plugin add cordova-plugin-camera
     
 
 ## navigator.camera.getPicture
@@ -432,4 +432,4 @@
     
     function onFail(message) {
         alert('Failed because: ' + message);
-    }
\ No newline at end of file
+    }
diff --git a/package.json b/package.json
index 8daeeae..7cfee23 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
   "version": "0.3.7-dev",
   "description": "Cordova Camera Plugin",
   "cordova": {
-    "id": "org.apache.cordova.camera",
+    "id": "cordova-plugin-camera",
     "platforms": [
       "firefoxos",
       "android",
@@ -38,6 +38,9 @@
     "cordova-browser",
     "cordova-windows"
   ],
+  "peerDependencies": {
+    "cordova-plugin-file": ">=1.0.1"
+  },
   "author": "Apache Software Foundation",
   "license": "Apache 2.0"
 }
diff --git a/plugin.xml b/plugin.xml
index 637b48d..4091e4c 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -21,7 +21,7 @@
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:rim="http://www.blackberry.com/ns/widgets"
-    id="org.apache.cordova.camera"
+    id="cordova-plugin-camera"
     version="0.3.7-dev">
     <name>Camera</name>
     <description>Cordova Camera Plugin</description>
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index b5574ab..f53a348 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -25,11 +25,15 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.net.URI;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 import org.apache.cordova.CallbackContext;
 import org.apache.cordova.CordovaPlugin;
 import org.apache.cordova.LOG;
 import org.apache.cordova.PluginResult;
+import org.apache.cordova.file.FileUtils;
 import org.json.JSONArray;
 import org.json.JSONException;
 
@@ -50,7 +54,7 @@
 import android.provider.MediaStore;
 import android.util.Base64;
 import android.util.Log;
-
+import android.content.pm.PackageManager;
 /**
  * This class launches the camera view, allows the user to take a picture, closes the camera view,
  * and returns the captured image.  When the camera view is closed, the screen displayed before
@@ -77,6 +81,8 @@
     private static final String GET_All = "Get All";
     
     private static final String LOG_TAG = "CameraLauncher";
+
+    //Where did this come from?
     private static final int CROP_CAMERA = 100;
 
     private int mQuality;                   // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
@@ -203,8 +209,8 @@
         // Save the number of images currently on disk for later
         this.numPics = queryImgDB(whichContentStore()).getCount();
 
-        // Display camera
-        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
+        // Let's use the intent and see what happens
+        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
 
         // Specify file so that large image is captured and returned
         File photo = createCaptureFile(encodingType);
@@ -212,7 +218,17 @@
         this.imageUri = Uri.fromFile(photo);
 
         if (this.cordova != null) {
-            this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
+            // Let's check to make sure the camera is actually installed. (Legacy Nexus 7 code)
+            PackageManager mPm = this.cordova.getActivity().getPackageManager();
+            if(intent.resolveActivity(mPm) != null)
+            {
+
+                this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
+            }
+            else
+            {
+                LOG.d(LOG_TAG, "Error: You don't have a default camera.  Your device may not be CTS complaint.");
+            }
         }
 //        else
 //            LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");
@@ -236,6 +252,8 @@
         return photo;
     }
 
+
+
     /**
      * Get image from photo library.
      *
@@ -296,13 +314,14 @@
    * 
    * @param picUri
    */
-  private void performCrop(Uri picUri) {
+  private void performCrop(Uri picUri, int destType, Intent cameraIntent) {
     try {
       Intent cropIntent = new Intent("com.android.camera.action.CROP");
       // indicate image type and Uri
       cropIntent.setDataAndType(picUri, "image/*");
       // set crop properties
       cropIntent.putExtra("crop", "true");
+
       // indicate output X and Y
       if (targetWidth > 0) {
           cropIntent.putExtra("outputX", targetWidth);
@@ -322,12 +341,18 @@
 
       if (this.cordova != null) {
         this.cordova.startActivityForResult((CordovaPlugin) this,
-            cropIntent, CROP_CAMERA);
+            cropIntent, CROP_CAMERA + destType);
       }
     } catch (ActivityNotFoundException anfe) {
       Log.e(LOG_TAG, "Crop operation not supported on this device");
-      // Send Uri back to JavaScript for viewing image
-      this.callbackContext.success(picUri.toString());
+      try {
+          processResultFromCamera(destType, cameraIntent);
+      }
+      catch (IOException e)
+      {
+          e.printStackTrace();
+          Log.e(LOG_TAG, "Unable to write to file");
+      }
     }
   }
 
@@ -342,16 +367,22 @@
 
         // Create an ExifHelper to save the exif data that is lost during compression
         ExifHelper exif = new ExifHelper();
+        String sourcePath;
         try {
-            if (this.encodingType == JPEG) {
-                exif.createInFile(getTempDirectoryPath() + "/.Pic.jpg");
-                exif.readExifData();
-                rotate = exif.getOrientation();
-            } else if (this.encodingType == PNG) {
-                exif.createInFile(getTempDirectoryPath() + "/.Pic.png");
-                exif.readExifData();
-                rotate = exif.getOrientation();
+            if(allowEdit && croppedUri != null)
+            {
+                sourcePath = FileHelper.stripFileProtocol(croppedUri.toString());
             }
+            else
+            {
+                sourcePath = getTempDirectoryPath() + "/.Pic.jpg";
+            }
+
+            //We don't support PNG, so let's not pretend we do
+            exif.createInFile(getTempDirectoryPath() + "/.Pic.jpg");
+            exif.readExifData();
+            rotate = exif.getOrientation();
+
         } catch (IOException e) {
             e.printStackTrace();
         }
@@ -361,7 +392,13 @@
 
         // If sending base64 image back
         if (destType == DATA_URL) {
-            bitmap = getScaledBitmap(FileHelper.stripFileProtocol(imageUri.toString()));
+            if(croppedUri != null) {
+                bitmap = getScaledBitmap(FileHelper.stripFileProtocol(croppedUri.toString()));
+            }
+            else
+            {
+                bitmap = getScaledBitmap(FileHelper.stripFileProtocol(imageUri.toString()));
+            }
             if (bitmap == null) {
                 // Try to get the bitmap from intent.
                 bitmap = (Bitmap)intent.getExtras().get("data");
@@ -384,14 +421,11 @@
 
         // If sending filename back
         else if (destType == FILE_URI || destType == NATIVE_URI) {
+            uri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg"));
+
             if (this.saveToPhotoAlbum) {
-                Uri inputUri = getUriFromMediaStore();
-                try {
-                    //Just because we have a media URI doesn't mean we have a real file, we need to make it
-                    uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova)));
-                } catch (NullPointerException e) {
-                    uri = null;
-                }
+                //Create a URI on the filesystem so that we can write the file.
+                uri = Uri.fromFile(new File(getPicutresPath()));
             } else {
                 uri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg"));
             }
@@ -422,20 +456,20 @@
                 // Restore exif data to file
                 if (this.encodingType == JPEG) {
                     String exifPath;
-                    if (this.saveToPhotoAlbum) {
-                        exifPath = FileHelper.getRealPath(uri, this.cordova);
-                    } else {
-                        exifPath = uri.getPath();
-                    }
+                    exifPath = uri.getPath();
                     exif.createOutFile(exifPath);
                     exif.writeExifData();
                 }
-                if (this.allowEdit) {
-                    performCrop(uri);
-                } else {
-                    // Send Uri back to JavaScript for viewing image
-                    this.callbackContext.success(uri.toString());
+
+                //Broadcast change to File System on MediaStore
+                if(this.saveToPhotoAlbum) {
+                    refreshGallery(uri);
                 }
+
+
+                // Send Uri back to JavaScript for viewing image
+                this.callbackContext.success(uri.toString());
+
             }
         } else {
             throw new IllegalStateException();
@@ -445,6 +479,24 @@
         bitmap = null;
     }
 
+private String getPicutresPath()
+{
+    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+    String imageFileName = "IMG_" + timeStamp + ".jpg";
+    File storageDir = Environment.getExternalStoragePublicDirectory(
+            Environment.DIRECTORY_PICTURES);
+    String galleryPath = storageDir.getAbsolutePath() + "/" + imageFileName;
+    return galleryPath;
+}
+
+private void refreshGallery(Uri contentUri)
+{
+    Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+    mediaScanIntent.setData(contentUri);
+    this.cordova.getActivity().sendBroadcast(mediaScanIntent);
+}
+
+
 private String ouputModifiedBitmap(Bitmap bitmap, Uri uri) throws IOException {
         // Create an ExifHelper to save the exif data that is lost during compression
         String modifiedPath = getTempDirectoryPath() + "/modified.jpg";
@@ -580,34 +632,47 @@
      */
     public void onActivityResult(int requestCode, int resultCode, Intent intent) {
 
-        // Get src and dest types from request code
+        // Get src and dest types from request code for a Camera Activity
         int srcType = (requestCode / 16) - 1;
         int destType = (requestCode % 16) - 1;
-        // if camera crop
-    if (requestCode == CROP_CAMERA) {
-      if (resultCode == Activity.RESULT_OK) {
-        // // Send Uri back to JavaScript for viewing image
-        this.callbackContext
-            .success(croppedUri.toString());
-        croppedUri = null;
-        
-      }// If cancelled
-      else if (resultCode == Activity.RESULT_CANCELED) {
-        this.failPicture("Camera cancelled.");
-      }
 
-      // If something else
-      else {
-        this.failPicture("Did not complete!");
-      }
+        // If Camera Crop
+        if (requestCode >= CROP_CAMERA) {
+            if (resultCode == Activity.RESULT_OK) {
 
-    }
+                // Because of the inability to pass through multiple intents, this hack will allow us
+                // to pass arcane codes back.
+                destType = requestCode - CROP_CAMERA;
+                try {
+                    processResultFromCamera(destType, intent);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    Log.e(LOG_TAG, "Unable to write to file");
+                }
+
+            }// If cancelled
+            else if (resultCode == Activity.RESULT_CANCELED) {
+                this.failPicture("Camera cancelled.");
+            }
+
+            // If something else
+            else {
+                this.failPicture("Did not complete!");
+            }
+        }
         // If CAMERA
-        if (srcType == CAMERA) {
+        else if (srcType == CAMERA) {
             // If image available
             if (resultCode == Activity.RESULT_OK) {
                 try {
-                    this.processResultFromCamera(destType, intent);
+                    if(this.allowEdit)
+                    {
+                        Uri tmpFile = Uri.fromFile(new File(getTempDirectoryPath(), ".Pic.jpg"));
+                        performCrop(tmpFile, destType, intent);
+                    }
+                    else {
+                        this.processResultFromCamera(destType, intent);
+                    }
                 } catch (IOException e) {
                     e.printStackTrace();
                     this.failPicture("Error capturing image.");
@@ -624,7 +689,6 @@
                 this.failPicture("Did not complete!");
             }
         }
-
         // If retrieving photo from library
         else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
             if (resultCode == Activity.RESULT_OK && intent != null) {
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index 74cb191..b913368 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -60,7 +60,7 @@
         });
         wv.on('JavaScriptCallback', function (evt, data) {
             var args = JSON.parse(data).args;
-            if (args[0] === 'org.apache.cordova.camera') {
+            if (args[0] === 'cordova-plugin-camera') {
                 if (args[1] === 'cancel') {
                     cancel('User canceled');
                 } else if (args[1] === 'error') {
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 30e5173..6eaa79d 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -185,7 +185,7 @@
 {
     NSInteger value = defaultValue;
 
-    NSNumber* val = [self valueForKey:key];  // value is an NSNumber
+    NSNumber* val = [dict valueForKey:key];  // value is an NSNumber
 
     if (val != nil) {
         value = [val integerValue];
diff --git a/tests/plugin.xml b/tests/plugin.xml
index 44e44c0..a71d83e 100644
--- a/tests/plugin.xml
+++ b/tests/plugin.xml
@@ -21,12 +21,12 @@
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:rim="http://www.blackberry.com/ns/widgets"
-    id="org.apache.cordova.camera.tests"
+    id="cordova-plugin-camera-tests"
     version="0.3.7-dev">
     <name>Cordova Camera Plugin Tests</name>
     <license>Apache 2.0</license>
     
-    <dependency id="org.apache.cordova.file" version=">=1.0.1" />
+    <dependency id="cordova-plugin-file" version=">=1.0.1" />
 
     <js-module src="tests.js" name="tests">
     </js-module>
diff --git a/www/blackberry10/assets/camera.js b/www/blackberry10/assets/camera.js
index 6d163d0..a149b93 100644
--- a/www/blackberry10/assets/camera.js
+++ b/www/blackberry10/assets/camera.js
@@ -20,7 +20,7 @@
 
 document.addEventListener('DOMContentLoaded', function () {
     document.getElementById('back').onclick = function () {
-        window.qnx.callExtensionMethod('org.apache.cordova.camera', 'cancel');
+        window.qnx.callExtensionMethod('cordova-plugin-camera', 'cancel');
     };
     window.navigator.webkitGetUserMedia(
         { video: true },
@@ -36,11 +36,11 @@
                 canvas.width = video.videoWidth;
                 canvas.height = video.videoHeight;
                 canvas.getContext('2d').drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
-                window.qnx.callExtensionMethod('org.apache.cordova.camera', canvas.toDataURL('img/png'));
+                window.qnx.callExtensionMethod('cordova-plugin-camera', canvas.toDataURL('img/png'));
             };
         },
         function () {
-            window.qnx.callExtensionMethod('org.apache.cordova.camera', 'error', 'getUserMedia failed');
+            window.qnx.callExtensionMethod('cordova-plugin-camera', 'error', 'getUserMedia failed');
         }
     );
 });