This page contains documentation for advanced Fuse features, so we have taken the liberty to tick the "Show advanced things" checkbox above for you in advance to be able to provide you with some additional information.

This module allows you to shows menu items when pressing App Icon on the device home screen. This feature refer to the home screen actions on iOS and App Shortcut on Android (introduced in Android 7.1 / API Level 25).

You need to add a reference to "Fuse.Shortcut" in your project file to use this feature.

This module is an EventEmitter, so the methods from EventEmitter can be used to listen to events.

Usage

The following example shows how create shortcut:

        <App>
            <JavaScript>

                var Observable = require("FuseJS/Observable")
                var selectedShortcut = new Observable("-")

                var shortcut = require("FuseJS/Shortcut");
                shortcut.registerShortcuts([
                    {
                        id: 'compose',
                        title: "Compose",
                        icon: "assets/images/compose.png"
                    },
                    {
                        id: 'profile',
                        title: "Profile",
                        icon: "assets/images/user.png"
                    },
                    {
                        id: 'book_store',
                        title: "Book Store",
                        icon: "assets/images/book.png"
                    }
                ])

                shortcut.on('shortcutClicked', (type) => {
                    selectedShortcut.value = type;
                })

                module.exports = {
                    selectedShortcut
                }

            </JavaScript>
            <StackPanel Margin="20">
                <Text Value="Selected Shortcut: {selectedShortcut}" />
            </StackPanel>
        </App>

Note that on the `registerShortcuts` method accepts array of json objects with the following properties:
* id, id of the shortcut, and will be passed on the `shortcutClicked` callback when particular shortcut get clicked. This property is mandatory
* title, to display menu title. This property is mandatory
* subtitle, to display sub title (displayed below the title on iOS). This property is optional
* icon, to display icon beside the menu title, value of the icon is a local image path (i.e asset path) not a url and must be registered as a Bundle. More info about Bundle [here.](/docs/assets/bundle). This property is optional

Location

Namespace
Fuse.Shortcut
Package
Fuse.Shortcut 2.9.1
Show Uno properties and methods

Interface of ShortcutModule

Inherited from NativeEventEmitterModule

Emit(object[]) uno

Call emit with the given arguments on the underlying JS EventEmitter.

Inherited from NativeModule

Inherited from Module

GetFile : FileSource uno

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.

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces