How exactly does it say “sharing failed”? I don’t see this error message in your code.
The cordova-plugin-x-socialsharing README has an error message like that, but also outputs some further information. Did you try that?
Yes the error message that is being displayed is coming from the plugin. I added an error callback handler to output the error message but it didn’t contain any additional information so not much help there.
I don’t think the error is related to the SocialSharing plugin. I feel its related to the Screenshot plugin. I will debug further and test using a sample image stored on my phone rather than the screenshot. At least that will rule out the SocialSharing plugin. It could be something related to sharing a image on WhatsApp.