Merge pull request #508 from rtpHarry/patch-1

docs(readme): app renamed to Google Photos
diff --git a/.appveyor.yml b/.appveyor.yml
index 72a4407..503030b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -12,12 +12,16 @@
   - Visual Studio 2017
 
 environment:
-  nodejs_version: "6"
-
   matrix:
-    - PLATFORM: windows-10-store
+    - nodejs_version: "10"
+    - nodejs_version: "12"
+
+platform:
+  - x86
+  - x64
 
 install:
+  - ps: Install-Product node $env:nodejs_version
   - node --version
   - npm install -g github:apache/cordova-paramedic
   - npm install -g cordova
@@ -25,4 +29,4 @@
 build: off
 
 test_script:
-  - cordova-paramedic --config pr\%PLATFORM% --plugin . --justBuild
+  - cordova-paramedic --config pr\windows-10-store --plugin . --justBuild
diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 0000000..29a6c7c
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+notifications:
+  commits:              commits@cordova.apache.org
+  issues:               issues@cordova.apache.org
+  pullrequests_status:  issues@cordova.apache.org
+  pullrequests_comment: issues@cordova.apache.org
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..45e3c38
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,3 @@
+.*
+appveyor.yml
+tests
diff --git a/.travis.yml b/.travis.yml
index a6d10e5..b141af3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-# This Travis configuration file is built after a Cordova Paramedic 
+# This Travis configuration file is built after a Cordova Paramedic
 # specific template with minimal modifications and adaptations:
 # https://github.com/apache/cordova-paramedic/blob/master/.travis.yml
 
@@ -12,18 +12,18 @@
 env:
   global:
     - SAUCE_USERNAME=snay
-    - TRAVIS_NODE_VERSION=8
+    - TRAVIS_NODE_VERSION=12
     - ANDROID_API_LEVEL=28
     - ANDROID_BUILD_TOOLS_VERSION=28.0.3
 
 language: node_js
-node_js: 8
+node_js: 12
 
 # yaml anchor/alias: https://medium.com/@tommyvn/travis-yml-dry-with-anchors-8b6a3ac1b027
 
 _ios: &_ios
   os: osx
-  osx_image: xcode10.2
+  osx_image: xcode10.3
 
 _android: &_android
   language: android
@@ -35,9 +35,9 @@
       - build-tools-$ANDROID_BUILD_TOOLS_VERSION
       - android-$ANDROID_API_LEVEL
     licenses:
-      - 'android-sdk-preview-license-.+'
-      - 'android-sdk-license-.+'
-      - 'google-gdk-license-.+'
+      - "android-sdk-preview-license-.+"
+      - "android-sdk-license-.+"
+      - "google-gdk-license-.+"
 
 matrix:
   include:
@@ -81,13 +81,13 @@
 
 before_install:
   # manually install Node for `language: android`
-  - if [[ "$PLATFORM" =~ android ]]; then nvm install $TRAVIS_NODE_VERSION; fi 
+  - if [[ "$PLATFORM" =~ android ]]; then nvm install $TRAVIS_NODE_VERSION; fi
   - node --version
   - if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
   - if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
   - npm install -g cordova
   # install paramedic if not running on paramedic repo
-  - if ! [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then npm install -g github:apache/cordova-paramedic; fi 
+  - if ! [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then npm install -g github:apache/cordova-paramedic; fi
 
 install:
   - npm install
@@ -106,11 +106,12 @@
       PARAMEDIC_COMMAND="cordova-paramedic"
     fi
   - PARAMEDIC_BUILDNAME=travis-$TRAVIS_REPO_SLUG-$TRAVIS_JOB_NUMBER
-  
+
 script:
   - $TEST_COMMAND
-  - if [[ "$ADDITIONAL_TESTS_DIR" != "" ]]; 
+  - |
+    if [[ "$ADDITIONAL_TESTS_DIR" != "" ]];
       then cd $ADDITIONAL_TESTS_DIR && npm install && npm test;
-    else 
-      $PARAMEDIC_COMMAND --config ./pr/$PLATFORM --plugin $PARAMEDIC_PLUGIN_TO_TEST --buildName $PARAMEDIC_BUILDNAME; 
+    else
+      $PARAMEDIC_COMMAND --config ./pr/$PLATFORM --plugin $PARAMEDIC_PLUGIN_TO_TEST --buildName $PARAMEDIC_BUILDNAME;
     fi
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4c8e6a5..21a93d7 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,13 +25,13 @@
 
 There are multiple ways to contribute: report bugs, improve the docs, and
 contribute code.
-
-For instructions on this, start with the 
+  
+For instructions on this, start with the
 [contribution overview](http://cordova.apache.org/contribute/).
 
 The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
+ - Check for Github issues that corresponds to your contribution and link or create them if necessary.
  - Run the tests so your patch doesn't break existing functionality.
 
 We look forward to your contributions!
+
diff --git a/README.md b/README.md
index df76d12..c9dcf69 100644
--- a/README.md
+++ b/README.md
@@ -482,11 +482,6 @@
         // do your thing here!
     }, 0);
 
-#### Windows Phone 7 Quirks
-
-Invoking the native camera application while the device is connected
-via Zune does not work, and triggers an error callback.
-
 #### Windows quirks
 
 On Windows Phone 8.1 using `SAVEDPHOTOALBUM` or `PHOTOLIBRARY` as a source type causes application to suspend until file picker returns the selected image and
@@ -545,7 +540,7 @@
         encodingType: Camera.EncodingType.JPEG,
         mediaType: Camera.MediaType.PICTURE,
         allowEdit: true,
-        correctOrientation: true  //Corrects Android orientation quirks
+        correctOrientation: true
     }
     return options;
 }
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 1dca07c..d4c084b 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -185,16 +185,16 @@
 
 - (void)showCameraPicker:(NSString*)callbackId withOptions:(CDVPictureOptions *) pictureOptions
 {
-    CDVCameraPicker* cameraPicker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
-    self.pickerController = cameraPicker;
-
-    cameraPicker.delegate = self;
-    cameraPicker.callbackId = callbackId;
-    // we need to capture this state for memory warnings that dealloc this object
-    cameraPicker.webView = self.webView;
-
     // Perform UI operations on the main thread
     dispatch_async(dispatch_get_main_queue(), ^{
+        CDVCameraPicker* cameraPicker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
+        self.pickerController = cameraPicker;
+
+        cameraPicker.delegate = self;
+        cameraPicker.callbackId = callbackId;
+        // we need to capture this state for memory warnings that dealloc this object
+        cameraPicker.webView = self.webView;
+
         // If a popover is already open, close it; we only want one at a time.
         if (([[self pickerController] pickerPopoverController] != nil) && [[[self pickerController] pickerPopoverController] isPopoverVisible]) {
             [[[self pickerController] pickerPopoverController] dismissPopoverAnimated:YES];
@@ -374,7 +374,7 @@
                     self.metadata = [[NSMutableDictionary alloc] init];
 
                     NSMutableDictionary* EXIFDictionary = [[controllerMetadata objectForKey:(NSString*)kCGImagePropertyExifDictionary]mutableCopy];
-                    if (EXIFDictionary)	{
+                    if (EXIFDictionary)    {
                         [self.metadata setObject:EXIFDictionary forKey:(NSString*)kCGImagePropertyExifDictionary];
                     }
 
@@ -398,7 +398,7 @@
     NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];
     NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe
     NSString* filePath;
-    
+
     // unique file name
     NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
     NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp];
@@ -513,9 +513,22 @@
 - (CDVPluginResult*)resultForVideo:(NSDictionary*)info
 {
     NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
+    // On iOS 13 the movie path becomes inaccessible, create and return a copy
+    if (IsAtLeastiOSVersion(@"13.0")) {
+        moviePath = [self createTmpVideo:[[info objectForKey:UIImagePickerControllerMediaURL] path]];
+    }
     return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
 }
 
+- (NSString *) createTmpVideo:(NSString *) moviePath {
+    NSString* moviePathExtension = [moviePath pathExtension];
+    NSString* copyMoviePath = [self tempFilePath:moviePathExtension];
+    NSFileManager* fileMgr = [[NSFileManager alloc] init];
+    NSError *error;
+    [fileMgr copyItemAtPath:moviePath toPath:copyMoviePath error:&error];
+    return [[NSURL fileURLWithPath:copyMoviePath] absoluteString];
+}
+
 - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
 {
     __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
@@ -587,15 +600,15 @@
 
 - (CLLocationManager*)locationManager
 {
-	if (locationManager != nil) {
-		return locationManager;
-	}
+    if (locationManager != nil) {
+        return locationManager;
+    }
 
-	locationManager = [[CLLocationManager alloc] init];
-	[locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
-	[locationManager setDelegate:self];
+    locationManager = [[CLLocationManager alloc] init];
+    [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
+    [locationManager setDelegate:self];
 
-	return locationManager;
+    return locationManager;
 }
 
 - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation