Windows Plugins

Windows Plugins

This section provides details for how to implement a plugin for use in a Windows Store app for Windows 8.1 phone and desktop, and Universal Windows Platform (Windows 10+). Before reading this, see Create your first plugin for an overview of the plugin's structure and its common JavaScript interface. This section continues to demonstrate the sample echo plugin that communicates from the Cordova webview to the native platform and back.

Creating a Windows Plugin in JavaScript

Windows Cordova plugins are essentially a thin wrapper around existing WinJS provided functions, but assuming you will want to define your JS common interface for multiple devices, you will typically have one JS file that provides the API:

// inside file echoplugin.js
var EchoPlugin = {
    // the echo functio