shareFile(path, mimetype, description) js
Share a file to another application by path.
Cross-app content sharing API for mobile targets. Supports sharing of raw text, and files with associated mimetype.
Uses Action Sheet on iOS and ACTION_SEND Intents on Android.
NB: on iPad, iOS design guidelines requires a point on screen as the origin for the share popover. You can do this by passing a reference to a UX element.
You need to add a reference to "Fuse.Share" in your project file to use this feature.
<JavaScript>
var Share = require("FuseJS/Share")
var Camera = require("FuseJS/Camera")
module.exports = {
shareFile : function()
{
Camera.takePicture(320,240)
.then(function(image) {
Share.shareFile(image.path, "image/*", "Photo from Fuse");
});
},
shareText : function()
{
Share.shareText("https://fuseopen.com/", "The link to Fuse Open website");
}
}
</JavaScript>
<Panel>
<Button Text="Share" Clicked="{shareText}"/>
<Panel ux:Name="ShareOrigin" Alignment="Center" Width="1" Height="1" />
<JavaScript>
var Share = require("FuseJS/Share")
module.exports = {
shareText : function()
{
// The iOS popover will use the position of ShareOrigin as its spawn origin
Share.shareText("https://fuseopen.com/", "The link to Fuse Open website", ShareOrigin);
}
}
</JavaScript>
</Panel>
Share a file to another application by path.
Share raw text to another application.
Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.