Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
  2.  
  3. cordova plugin add https://github.com/gitawego/cordova-screenshot.git
  4.  
  5. $ cordova prepare
  6.  
  7. <script>
  8. function sharePhoto() {
  9. var imageLink;
  10. console.log('Calling from CapturePhoto');
  11. navigator.screenshot.save(function(error,res){
  12. if(error){
  13. console.error(error);
  14. }else{
  15. console.log('ok',res.filePath); //should be path/to/myScreenshot.jpg
  16. imageLink= res.filePath;
  17. window.plugins.socialsharing.shareVia('com.apple.social.facebook', 'Message via FB', null, imageLink, null, function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})
  18. }
  19. },'jpg',50,'myScreenShot');
  20. }
  21. </script>
  22.  
  23. <button onclick="sharePhoto();">Share Screenshot</button>
  24.  
  25. 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