gitawego / cordova-screenshot

screenshot plugin for cordova/phonegap
Other
211 stars 167 forks source link

Doesn't work on IOS #106

Open CapozXVII opened 7 years ago

CapozXVII commented 7 years ago

Hi I'm using Cordova 6.4.0 and the plugin com.darktalker.cordova.screenshot 0.1.5 "Screenshot". This is my simple code

navigator.screenshot.save(function(error, res) { if(error) { alert(error); } else { alert(res.filePath); //just to see the path } }, 'jpg'); The code works on android: the screenshot is taken and saved, so I can use it. However, it doesn't work on iOS: I can't find the screenshot. How can I solve?

spanishsnapper commented 6 years ago

Also having problems - Cordova 8.0.0 built on mac.

Plugins are copied to platform directories and give no error in xCode build, but Screenshot function does not fire (no error/success response)

Is there a maximum iOS version or Cordova version this is compatible with?

nicks258 commented 6 years ago

did you find a solution for this?? @CristCapo @spanishsnapper @macdonst @gitawego @tony--

globules-io commented 6 years ago

Same issue here with cordova 7.1.0 + ios 4.5.4. It fails silently and acts like it is successful...

AugustoNapuri commented 5 years ago

Hey, i figured out a way to make it runnable in IOS and Android at the same time. Use this fork and the code above that i will write. (Note that you can only have 1 of this plugins installed) navigator.screenshot.URI(function (error, res) { if (error) { console.error(error); } else { window.plugins.socialsharing.available(function (isAvailable) { // the boolean is only false on iOS < 6 console.log(res.URI); if (isAvailable) { window.plugins.socialsharing.share(null, null, res.URI, null); } else { console.log("Something gone wrong"); } }); } }, 50);

https://github.com/perry2of5/cordova-screenshot-crosswalk-ios-only

letincho5 commented 4 years ago

Same issue here with cordova 8 + iOS 4.4.0. It fails silently... never go inside the function:

navigator.screenshot.save(function (error, res) { alert('hello'); });

I've try also with:

navigator.screenshot.save(function (error, res) { alert('hello'); }, 'jpg', 50);

Any ideas?

Run on Android OK!

kelreynders commented 4 years ago

anyone a solution that works?

kelreynders commented 4 years ago

For me, it does not work on android. Is the path still sdcard/pictures?