$scope.shareAnywhere = function () {
$('.share_overlay').show();
$cordovaScreenshot.capture()
.then(function (result) {
$cordovaSocialSharing.share(null, null, 'file://' + result, null).then(function (result) {
$('.share_overlay').hide();
}, function (err) {
$('.share_overlay').hide();
console.log("there was an error sharing!");
});
}, function (err) {
$('.share_overlay').hide();
console.log("there was an error taking a a screenshot!");
});
}
I got black image as screenshot in android 5+ Versions
/ Cordova Screenshot Code/
app.service('$cordovaScreenshot', ['$q', function ($q) { return { capture: function (filename, extension, quality) { extension = extension || 'jpg'; quality = quality || '100';
}]);
/ Social Sharing Code /
I also used that crosswalk line