Ionic View crashes when trying to take and upload a picture

Hi, I’m coding an app that works fine in my browser emulator, but crashes when I try to do a specific function in Ionic View. My device is an iPhone 4. I am aware that the finished app has to be developed on iOS to have it run on iPhones, but I was under the impression that it didn’t matter if it was in Ionic View (plus, everything else in my app works).

When I tap the Photo Upload button, I’m asked if I want to either “Take Photo or Video”, “Choose Existing”, or “Cancel” in a drop down menu. If I choose anything but Cancel, I am immediately taken back to the “My Apps” section of Ionic View. Any attempt to view the App again without first completely restarting Ionic View is met with an eternal loading time.

The code for this function is here.

.controller(‘uploadCtrl’, [’$scope’, ‘Upload’, function ($scope, Upload, dataService, Camera)
{
$scope.$watch(‘files’, function(){
$scope.upload($scope.files);
});
$scope.upload = function (files)
{
console.log(“Function Called”);

                                  //console.log(sharedProperties.);
                                  if(files && files.length){
                                      for (var i = 0; i <files.length; i++)
                                      {
                                          var file = files[i];
                                          console.log("Function looping");
                                          Upload.upload
                                          ({
                                              url: '/',
                                              method: 'POST',
                                              fields: {key: "catpicture",
                                                      AWSAccessKeyId: 'Not Showing',
                                                      acl: 'private',
                                                      policy: '',
                                                      signature: '=',
                                                      "Content-Type": file.type != '' ? file.type : 'application/octet-stream',
                                                       success_action_redirect: "google.com",
                                                      filename: "catpicture"},
                                              file: file
                                          }).progress(function(evt){
                                              var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
                                              console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);}).success(function(data,status,headers,config){
                                                  console.log('file ' + config.file.name + ' uploaded. Response: ' + data);
                                              });
                                      }
                                  }
                              };
                          }]);

And the accompanying html code is here.
> button ngf-select=“upload($files)” class=“button button-block button-stable”>

        Photo Upload
   /button>

(I have valid signatures and all for the upload parameters, I just removed them so I wouldn’t be posting them online publicly.Also, not sure on how to format HTML on here without it disappearing, but I removed the < from the first and last lines of the HTML that I posted.

I noticed this yesterday as well, where I have there typical input type file and when iOS give me its default behaviour to choose from gallery or take a pictures the app crashes.

I can confirm this too. Any news on this? Thank you!

+1
I can confirm this. When trying to upload image, on selecting ‘take a picture’/‘choose existing’, ionic view crashes.

Hi!, this issue i guess is for multiple threads or some like that, i am not an expert, but i have the same problem and when you open the window to choose the image a new thread is open, you select the photo or file and when the app return to webview, it cant return the data because is in diferent thread and then crash!. Can you solve this problem??, any way i write my advance here, i hope to be helpful

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

Check your config.xml