Cordova plugin development in C# for Windows 8.1 / Windows 10

前端 未结 1 1078
甜味超标
甜味超标 2021-01-06 03:49

Is it possible to write a Cordova plugin for Windows (8.1/10) in C#? Alternatively, can a library component written in C# be wrapped as a Cordova plugin? If I haven\'t mis

相关标签:
1条回答
  • 2021-01-06 04:21

    Yes but there are some requirements. First, your library must be a Windows Runtime Component project. You can reference a winmd or a csproj in your plugin (see https://cordova.apache.org/docs/fr/latest/guide/platforms/win8/plugin.html). If your plugin is valid and correctly loaded in your application at runtime, you can use your C# classes in JavaScript directly (it's just WinJS). It's your responsability to expose a JavaScript wrapper of your C# library in the plugin, but it's not mandatory (just common to maximize code sharing with other platforms implementations of your plugin).

    0 讨论(0)
提交回复
热议问题