cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Sawatzky (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-5589) NATIVE_URI returns null on iOS 7
Date Thu, 01 May 2014 20:14:15 GMT

    [ https://issues.apache.org/jira/browse/CB-5589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13986939#comment-13986939
] 

Jeff Sawatzky commented on CB-5589:
-----------------------------------

The reason for this is that the plugin does the following:

{code}
if (cameraPicker.returnType == DestinationTypeNativeUri) {
    NSString* nativeUri = [(NSURL*)[info objectForKey:UIImagePickerControllerReferenceURL]
absoluteString];
    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
}
{code}

However, when capturing an image, the UIImagePickerController doesn't return a url, and instead
returns an UIImage.

> NATIVE_URI returns null on iOS 7
> --------------------------------
>
>                 Key: CB-5589
>                 URL: https://issues.apache.org/jira/browse/CB-5589
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS, Plugin Camera
>    Affects Versions: 3.1.0
>         Environment: iPhone 5 running iOS 7.0.4.
>            Reporter: John M. Wargo
>
> Using Camera.DestinationType.NATIVE_URI on iOS returns null. 
> Also, not sure if this is important, but on Android, it returns the same URI you get
with Camera.DestinationType.FILE_URI. 
> Here's my code:
> function takePhoto() {       
>         var cameraOptions = {
>           destinationType : Camera.DestinationType.NATIVE_URI,
>           sourceType : Camera.PictureSourceType.CAMERA
>         }
>         navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);     
  
>       }
>      
>       function cameraSuccess(res) {
>         console.log("Result: " + res);        
>       }
>       function cameraError(errObj) {        
>         console.error(JSON.stringify(errObj));
>         navigator.notification.alert(JSON.stringify(errObj), null, "Camera Error", "Continue");
       
>       }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message