Add custom cordova plugin v2


Hey guys, first post here.

I’m developing an android app, and writing a plugin to take the installation referrer.

My current problem is that i’m unable to use my (basic) plugin in v2.

This is the plugin.xml (from a tutorial):

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns=""
		<name>My Cordova Plugin</name>

		<js-module src="www/plugin.js" name="plugin">
			<clobbers target="MyCordovaPlugin" />

		<platform name="android">
			<config-file target="rex/xml/config.xml" parent="/*">
				<feature name="MyCordovaPlugin">
					<param name="android-package" value="com.example.MyCordovaPlugin" />
			<source-file src="src/android/com/example/" target-dir="src/com/example/" />

and, in app.component i tried using window.plugins, (window).plugins and declare var MyCordovaPlugin : any;

but nothing works. I’m crushing my head into the wall. Can you help me? Thank you.