0
ios 11で動作するipadにデプロイされたionic v1アプリケーションを使用しています。ipadでアプリケーションを実行してカメラボタンをクリックしようとすると、何も起こりません。それはそのままです。私はios 10と同様の問題点を探して、info.plstファイルの関連タグを追加し、クロスフレームセキュリティバイパスを追加しました。私は周りを見回しましたが、これに対する解決策はありませんでした。私は$ cordovaCamera.getPicture()の代わりにnavigator.camera.getPicture()を使用しようとしましたが、そのコードではどちらも問題ありませんでした。 。私の見解では
私はコントローラで
<a ng-click="takePicture()" style="color:#fff;">
を持っている私は$ cordovaCameraをも注入されているコントローラで
$scope.takePicture = function (options) {
var options = {
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
quality: 100,
targetWidth: 300,
targetHeight: 300,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false,
correctOrientation:true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
console.log('here');
$scope.pictureUrl = "data:image/jpeg;base64," + imageData;
console.log(imageData);
$scope.img_update = 1;
}, function(err) {
console.log(err);
});
};
を持っています。
私は、プラットフォームのIOS内でこれらのタグを追加している私はconfig.xmlに<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *">
を追加したのindex.htmlで
は
<plugin name="cordova-plugin-camera" spec="~2.3.0">
<variable name="CAMERA_USAGE_DESCRIPTION" value="The app would like to access the camera when you attach photos to content." />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="The app would like to access the photo library when you attach images to content." />
</plugin>
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to save pictures there</string>
</edit-config>
@ArkoD上記の解決策をお試しください。 – Dixit
私は今日それを試してみましょう、あなたに知らせてください。ありがとう。 – ArkoD
@ArkoD OK。ありがとう – Dixit