You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jeff Sawatzky (JIRA)" <ji...@apache.org> on 2014/05/01 22:14:15 UTC

[jira] [Commented] (CB-5589) NATIVE_URI returns null on iOS 7

    [ 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)