How to call custom cordova plugin (following example in medium.com article)?


#1

This article https://medium.com/ionic-and-the-mobile-web/how-to-write-cordova-plugins-864e40025f2 explains how to create a custom Cordova plugin. I built the template ionic tabs app and followed the instructions in the article. The article explains that the plugin can be called like this:

window.MyCordovaPlugin.echo(‘Hello!’, function() { //callback })

When I try to call the function as listed above I get the error message: “Property ‘MyCordovaPlugin’ does not exist on type ‘Window’” when running on iOS. This question was asked in the comments section of the medium.com article, but has not yet been answered there. Is the syntax for calling the echo function wrong? Am I missing an import step? Any help would be appreciated.