cordova-screenshot icon indicating copy to clipboard operation
cordova-screenshot copied to clipboard

Doesn't work on IOS

Open CapozXVII opened this issue 7 years ago • 7 comments

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?

CapozXVII avatar Apr 12 '17 10:04 CapozXVII

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?

spanishsnapper avatar Feb 07 '18 13:02 spanishsnapper

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

nicks258 avatar Mar 09 '18 06:03 nicks258

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

globules-io avatar Mar 28 '18 00:03 globules-io

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

AugustoNapuri avatar Feb 05 '19 14:02 AugustoNapuri

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!

letincho5 avatar Oct 01 '20 10:10 letincho5

anyone a solution that works?

kelreynders avatar Oct 27 '20 16:10 kelreynders

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

kelreynders avatar Oct 28 '20 16:10 kelreynders