You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/18 20:44:08 UTC

[GitHub] [cordova-plugin-camera] riddletd commented on issue #506: iOS13 file_uri error picking video from gallery

riddletd commented on issue #506: iOS13 file_uri error picking video from gallery
URL: https://github.com/apache/cordova-plugin-camera/issues/506#issuecomment-555200663
 
 
   > > Hi again!
   > > Here is the solution (sorry, I don't know how to open a new tree), to help any other user.
   > > **in CDVCamera.m change THIS:**
   > > 
   > > * (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   > >   {
   > >   NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
   > >   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
   > >   }
   > > 
   > > **to THIS:**
   > > 
   > > * (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   > >   {
   > >   NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
   > >   NSArray* spliteArray = [moviePath componentsSeparatedByString: @"/"];
   > >   NSString* lastString = [spliteArray lastObject];
   > >   NSError *error;
   > >   NSFileManager *fileManager = [NSFileManager defaultManager];
   > >   NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"tmp"];
   > >   NSString *filePath = [documentsDirectory stringByAppendingPathComponent:lastString];
   > >   [fileManager copyItemAtPath:moviePath toPath:filePath error:&error];
   > >   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
   > >   }
   > 
   > I can confirm that this fix worked for us for iOS 13.2.2.
   > We also tested this on an iPhone running iOS 12.4.1 for backward compatibility.
   > Both are working correctly with this fix.
   > I have **not** yet tested 13.2 or 13.1. Anyone?
   
   This works for me. iOS 13.1.3

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org