Same issue. console.log(this.screenshot)
gives me a normal result, but this.screenshot.URI()
does not work. It always returns TypeError: undefined is not an object (evaluating 'navigator.screenshot.URI')
.
What does “normal result” mean? Is “URI” in that logged object?
Oh, and navigator.screenshot
of course is something completely different.
console.log(this.screenshot)
returns its prototype and properties. But when I run this.screenshot.URI(80)
, it always returns TypeError: undefined is not an object (evaluating 'navigator.screenshot.URI')
. And it does not work on iOS too.
Console.log navigator
, navigator.screenshot
and navigator.screenshot.URI
please.
Thanks for helping! screenshot does not exist in navigator, so they cannot be logged. console.log(navigator)
shows below:
this.screenshot
is something you define and set it to the object of the Ionic Native Screenshot plugin.
navigator.screenshot
is something the Cordova Plugin for screenshot defines.
You don’t seem to have the Cordova plugin installed, only the Ionic Native plugin. Possible?
Solved. It now works on iOS. I think I might have a typo somewhere but I corrected it along the way.
Below is my working code.
share() {
this.screenshot.URI(80).then(res => {
this.socialSharing.share("",
"",
res.URI,
""
);
}).catch(err => {
console.log(err);
});
}
@Sujan12 Thank you for your help!