iOS 9 ngCordova support?


#1

Hi guys,

I would like to use ngCordova camera plugin but I am not sure if it supports iOS9. Or are there any work around?

Thanks in advance.

Best Regards.


#2

Have you tried? It works for me on IOS9


#3

unfortunately it doesn’t work for me, would you please share your example? I am new to cordova and ionic.


#4

Sure, I just compiled it for an IOS9 phone this morning

I have this code to take a picture (the controller adds $cordovaCamera to the dependencies) and display it on the screen

The plugin is:
org.apache.cordova.camera 0.3.6 “Camera”

$scope.takePicture = function() {
        var options = { 
            quality : 75, 
            destinationType : Camera.DestinationType.DATA_URL, 
            sourceType : Camera.PictureSourceType.CAMERA, 
            allowEdit : true,
            encodingType: Camera.EncodingType.JPEG,
            targetWidth: 390,
            targetHeight: 207,
            popoverOptions: CameraPopoverOptions,
            saveToPhotoAlbum: false
        };
 
        $cordovaCamera.getPicture(options).then(function(imageData) {
            $scope.imgURI = "data:image/jpeg;base64," + imageData;
            var alertPopup = $ionicPopup.alert({
      title: 'Thank You',
      template: 'We will analyze the coupon and add it to your stack'
    });
            
        }, function(err) {
            // An error occured. Show a message to the user
        });
    
 };

My template that invokes it:

<ion-tab title="Add" icon="ion-camera">
            <ion-nav-view>
                <ion-content>
                    <br/>
                    <center>
                        Have a coupon we don't know about?
                        <br/> Take a photo right here and we'll add it to
                        <br/> your coupon stack in a jiffy!

                        <br/>
                        <br/>
                        <button class="button" ng-click="takePicture()">Upload new coupon</button>
                        <br/>
                        <br/>
                        <img ng-show="imgURI !== undefined" ng-src="{{imgURI}}">
                        <img ng-show="imgURI === undefined" ng-src="img/placeholder.jpg" width="390px" height="207px">

                    </center>
                </ion-content>
            </ion-nav-view>

        </ion-tab>

#5

Hi pliablepixels,

Is yours this plugin?

http://ngcordova.com/docs/plugins/camera/


#6

Yes, that seems right - I am using 0.3.6


#7

are you implementing via VS 2013 or CLI?


#8

Not sure what you mean. The camera plugin was added via cordova plugin add and to build it I do a ionic build iOS or ionic build android as needed. For iOS I create the package via Xcode after that


#9

Hi,

I don’t know Xcode, just using it indirectly for build and etc.by VS 2013. So thats why I need to know how to use both CLI and VS 2013 in this situation. Is there a tutor or something?

Best Regards.


#10

I am using VS 2015 and installed bower, angular, ionic and ngcordova. No problem.