Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
- cordova plugin add https://github.com/gitawego/cordova-screenshot.git
- $ cordova prepare
- <script>
- function sharePhoto() {
- var imageLink;
- console.log('Calling from CapturePhoto');
- navigator.screenshot.save(function(error,res){
- if(error){
- console.error(error);
- }else{
- console.log('ok',res.filePath); //should be path/to/myScreenshot.jpg
- imageLink= res.filePath;
- window.plugins.socialsharing.shareVia('com.apple.social.facebook', 'Message via FB', null, imageLink, null, function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})
- }
- },'jpg',50,'myScreenShot');
- }
- </script>
- <button onclick="sharePhoto();">Share Screenshot</button>
- cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement