/ fuse

Making Phone Calls with Fuse

When Drake made "Hotline Bling", he was referencing a 'cell phone' which had to have had an application with phone call functionality. Let's build exactly that with Fuse.

Setup

To get started, let's make ourselves a new Fuse project.


# Create a new application
$ fuse create app PhoneCall

Now we have to add the Fuse.Launcher package to our PhoneCall.unoproj

{
  "RootNamespace":"",
  "Packages": [
    "Fuse",
    "FuseJS",
    "Fuse.Launcher"
  ],
  "Includes": [
    "*"
  ]
}
Application

I'm then adding a Button to our MainView.ux which is attached to a Clicked event, allowing us to call a phoneCall function within our JavaScript.

<App>
    <Button Clicked={phoneCall} Text="Call"></Button>
</App>

Now, we can access the Phone library and call the phone.call function. As we've exported the function, it's then in the scope of our Button's Clicked event.

<JavaScript>
    var phone = require("FuseJS/Phone");

    module.exports = {
        phoneCall: function() {
            phone.call("+447983298732");
        }
    }
</JavaScript>

You should now be able to make phone calls within your Fuse applications! :)

Paul Halliday

Progress Telerik Developer Expert. Course author with students in 110+ countries. BSc (Hons) Computer Science @ UoS. Google accredited Mobile Site professional.

Read More