Share a local image

I read the Share api https://www.fusetools.com/docs/fuse/share/sharemodule. But I can’t make work with a image stored in the Asset folder. I’ts possible to do that with this api?

Thanks!

The file you want to share lives inside :Bundle, while the Share API works with files that are directly available in the storage.

To make this work, you should first save the file from bundle to storage using FuseJS/Bundle and FuseJS/FileSystem. Then you can use the resulting path with Share API.

I try with no luck… I try like this:

Js:

var Bundle = require("FuseJS/Bundle");
var FileSystem = require("FuseJS/FileSystem");
var Share = require("FuseJS/Share");

function Share() {
    var path = FileSystem.dataDirectory + "Assets/MyImage.png";
    Share.shareFile(path, "image/*", "My message");
}

.unoproj:

"Includes": [
    "Assets/MyImage.png:Bundle",
  ],

Now I try:

function Share() {
    Bundle.extract('Assets/MyImage.png', FileSystem.dataDirectory + '/MyImage.png')
    .then(function(resultPath) {
        console.log(resultPath);
        Share.shareFile(resultPath, "image/*", "Message");
    });
}

the console.log give me /data/user/0/com.goodfactory.wali/files/MyImage.png but the com.goodfactory.wali folder don’t exist and the Share don’t work

I test it on an Iphone and works! Is an Android bug.

But in IOS only share the image without the text description!

Thanks for reporting; I’ve logged a ticket to further investigate this.