撮影した写真をInstagramに共有しようとしています。私はインストールしましたsocial share plugin from ngCordova website写真をInstagramとIonicで共有する方法
しかし、私はそれを動作させることができません。それを実行するとエラーは発生しません。 私は成功の応答を得るが、イメージはInstagramの壁に掲示されていない。
ログからの印刷画面です(xcode - >実際のデバイスからテストまで実行中)。
私が間違っていることを誰でも見ることができますか?ここで
は私のコントローラのコードの一部です:
app.controller('CameraCtrl', function($scope, $cordovaCamera, $cordovaSocialSharing, $rootScope, $state){
$scope.takePicture = function(){
var options = {
quality: 75,
destinationType: Camera.DestinationType.DATA_URI,
sourceType: Camera.PictureSourceType.CAMERA,
encodingType: Camera.EncodingType.JPEG,
saveToPhotoAlbum: true,
correctOrientation:true
};
$cordovaCamera.getPicture(options)
.then(function(imageURI){
var imagePlaceholder = document.getElementById('placeholderPicture');
imagePlaceholder.src = imageURI;
$rootScope.imgShare = imageURI;
//$scope.imgURI = "data:image/jpeg;base64," + imageURI;
//$state.go('app.camera', {image: $scope.imgURI});
//console.log('camera data: ' + angular.toJson(imageURI));
}, function(error){
console.log('error camera data: ' + angular.toJson(imageURI));
});
}
$scope.shareViaInstagram = function(message, image){
socialType = "instagram";
message = "test";
image = $rootScope.imgShare;
$cordovaSocialSharing.shareVia(socialType, message, image, null).then(function(result) {
console.log('image shared to Instagram ', result);
console.log('dddd', image);
console.log('######', $rootScope.imgShare);
//$state.go('app.finish');
}, function(err) {
console.log('error in sharing to Instagram ', err);
});
}
});
私のhtmlコードの一部:
<div class="wrapperCamera">
<div class="cameraContent padding">
<img id="placeholderPicture" ng-src="{{imgShare}}">
<br>
<h2 class="customH2Camera">looking good!</h2>
<br><br>
<div class="socialIcons">
<a href="" ng-click="shareViaInstagram(null, null, imgShare, null)"><img src="img/iconInstagram.svg" width="40"></a>
<a href="" ng-click="shareViaFacebook(null, null, imgShare, null)"><img src="img/iconFacebook.svg" width="40"></a>
</div>
</div><!-- end cameraContent -->
</div><!-- end WrapperCamera -->
あなたはNG-コルドバが欠落していることができますか? –
いいえ、私のapp.jsファイルに追加しました – GY22
あなたが問題になっているエラーを追加してください。 –