# Native Android's alert dialog

**URL:** <https://forums.fusetools.com/t/native-androids-alert-dialog/4167>\
**Category:** General\
**Created:** [January 30, 2018, 1:11pm UTC](https://forums.fusetools.com/t/native-androids-alert-dialog/4167 "2018-01-30T13:11:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riva\_Farabi](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Riva\_Farabi](https://forums.fusetools.com/u/Riva_Farabi)\
**Post date:** [January 30, 2018, 1:11pm UTC](https://forums.fusetools.com/t/native-androids-alert-dialog/4167/1 "2018-01-30T13:11:23Z")

</div>

Is Android’s alert dialog already supported in Fuse library yet?  
I took a look in version 1.6’s library directory and found Fuse.Alerts in it. Is it the same thing as native dialog? If it is, How I can use it?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [January 30, 2018, 1:53pm UTC](https://forums.fusetools.com/t/native-androids-alert-dialog/4167/2 "2018-01-30T13:53:09Z")

</div>

Hi Riva,

`Fuse.Alerts` package allows you to show native “confirm” and “alert” dialogs. It is weird that it’s missing from our docs, so we’ll look into that.

As for using it, it’s quite simple. First, you need to add `"Fuse.Alerts"` under `"Packages"` in your .unoproj file, and then go wild with the dialogs:

```auto
<App>
    <JavaScript>
        var Alerts = require("FuseJS/Alerts");

        function showAlert() {
            Alerts.alert("Alert", "description", "OK").then(function(x) {
                console.log("alert closed, got: " + x);
            });
        }

        function showConfirm() {
            Alerts.confirm("Confirm", "description", "YES", "NO").then(function(x) {
                console.log("confirm closed, got: " + x);
            });
        }

        module.exports = {
            showAlert: showAlert,
            showConfirm: showConfirm
        };
    </JavaScript>

    <StackPanel Alignment="VerticalCenter" ItemSpacing="4">
        <Panel Width="128" Height="48" Clicked="{showAlert}">
            <Text Value="Show alert" Color="#fff" Alignment="Center" />
            <Rectangle CornerRadius="2" Color="#18f" />
        </Panel>
        <Panel Width="128" Height="48" Clicked="{showConfirm}">
            <Text Value="Show confirm" Color="#fff" Alignment="Center" />
            <Rectangle CornerRadius="2" Color="#18f" />
        </Panel>
    </StackPanel>
</App>

```

Note that the dialogs only show up on mobile devices, and do nothing in local preview.

This package also isn’t currently supported when previewing via the “Fuse Preview” mobile app, so make sure you deploy your builds over USB.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Riva\_Farabi](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Riva\_Farabi](https://forums.fusetools.com/u/Riva_Farabi)\
**Post date:** [January 30, 2018, 3:04pm UTC](https://forums.fusetools.com/t/native-androids-alert-dialog/4167/3 "2018-01-30T15:04:55Z")

</div>

Sweet! Cannot wait to try this for my app!
