Reputation: 1283
I am using this plugin for sharing images on my Android Phonegap project. https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
To share an image I am calling plugin with these parameters
window.plugins.socialsharing.share('Title', null,'/data/data/com.example.app/images/myimage.jpg', null);
and then getting the below error:
file:///android_asset/www/plugins/nl.x-services.plugins.socialsharing/www/SocialSharing.js: Line 93 : The injected error callback of 'share' received: "URL_NOT_SUPPORTED"
The image file that I am trying to share was created with Context.MODE_PRIVATE permission.
File myImageFile= new File(context.getDir("images", Context.MODE_PRIVATE), "myimage.jpg");
I doubt that one of these could be possible reason for the failure:
Upvotes: 3
Views: 2266
Reputation: 71
I was having a similar issue and solved it by explicitly prepending the filepath with file://
if(application.isAndroid) {
filePath = 'file://' + filePath;
}
Upvotes: 7