I followed this tutorial about how to write Cordova plugin. Now I'm trying to add the plugin into my iOS project like this :
cd /Users/Admin/Desktop/testpluginswift/testapp
cordova plugin add /Users/Admin/Desktop/testpluginswift/TestPluginSwift/
Then I got this errors :
(node:11661) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Invalid Plugin! /Users/Admin/Desktop/testpluginswift/TestPluginSwift/ needs a valid package.json
(node:11661) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
So what I did was :
plugman createpackagejson /Users/Admin/Desktop/testpluginswift/TestPluginSwift/
But now I get this error:
(node:11528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError
(node:11528) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
How can I solve this problems? thanks