PhoneGap Camera API not working for iOS

2019-09-06 15:23发布

问题:

The PhoneGap camera API is not being called from my controller.

The code is :

navigator.camera.getPicture(this.onPhotoDataSuccess(), this.onFail(),
                                  { quality: 80,destinationType: Camera.DestinationType.DATA_URL,
                                  sourceType: Camera.PictureSourceType.PHOTOLIBRARY});

But no called being made to the navigator.camera.getPicture() function. Can anyone point out what am i missing?

回答1:

Try this:

navigator.camera.getPicture(this.onPhotoDataSuccess, this.onFail,
                              { quality: 80,destinationType: Camera.DestinationType.DATA_URL,
                              sourceType: Camera.PictureSourceType.PHOTOLIBRARY});

You could also try/have a look at the PhoneGap sample app that includes taking a picture and showing it on the local html page.

Hope this helps!