I found both ion2-calendar and ionic2-calendar plugins in a same project
what is the difference between the two of them.
Also, I wish to know, these plugins are not listed by the command
ionic cordova plugin list
How to get the list of plugins installed other than cordova?
Below is the portion of package.json of that project.
"ion2-calendar": "^3.0.0-rc.0",
"ionic-angular": "^3.9.9",
"ionic2-calendar": "^0.5.7",
Found both are different
ion2-calendar is a plugin installed as below:
npm install ion2-calendar moment --save
Documentation :
https://www.npmjs.com/package/ion2-calendar
ionic2 calendar is a plugin installed as below:
npm install ionic2-calendar --save
Documentation:
http://www.codeexpertz.com/blog/mobile/ionic-2-calendar
both are having lot of different workaround
but both plugins are working in a same project without any clash.
This will help who are having some confusion about which one to be used.
Related
The npm install docs explains how to install a dependency from the github source code rather than using the npm registry.
It works well when your project isn't scoped, so that if I wanna install express I can just execute:
npm install https://github.com/expressjs/express
and it works well.
In the ionic plugin case, though, this doesn't work correctly.
Ionic plugins are scoped, if I want to install the speech recognition plugin from the npm registry I can just execute:
npm install #ionic-native/speech-recognition
This is the #ionic-native/speech-recognition npm page.
On the right sidebar there's the link to the corresponding github page, which is https://github.com/ionic-team/ionic-native.
If I try to execute:
npm i https://github.com/ionic-team/ionic-native/speech-recognition
It installs only the #ionic-native dependency rather than the plugin.
The same about:
npm i #ionic-native/speech-recognition#https://github.com/ionic-team/ionic-native
In both cases, the output is:
#ionic-native/speech-recognition#https://github.com/ionic-team/ionic-native
npm WARN #ionic-native/ionic-webview#5.28.0 requires a peer of
#ionic-native/core#^5.1.0 but none is installed. You must install peer
dependencies yourself. npm WARN uglifyjs-webpack-plugin#0.4.6 requires
a peer of webpack#^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but
none is installed. You must install peer dependencies yourself.
ionic-native#5.28.0 updated 1 package and audited 1602 packages in 38.072s
Which only adds the following row in the package.json:
"ionic-native": "git+https://github.com/ionic-team/ionic-native.git"
If you are asking why I need it, it's because I need to install a forked repo.
How can I install a ionic plugin from the github repository?
Thank you
Most of the plugins used by the Ionic Framework where created for Cordova/Phonegap way before Ionic was published. These are the main technologies that Ionic was built uppon, so you can find the information where and how to download the plugins from the Cordova and Phonegap Github pages or official website.
Speech Recognition for Cordova
I've been working through this example:
https://capacitor.ionicframework.com/docs/basics/cordova
I've run:
npm install cordova-plugin-qrscanner
npx cap sync
and I can see the plugin installed in my node_modules.
What I do not know how to do is call one of the functions on the cordova-plugin. I'm wondering if I need a packager like webpack?
I'm also confused as to how this works if the cordova plugin contains native swift (or other) code.
Remember you can install the native wrapper too. It should work just the same as using it with Cordova.
npm install #ionic-native/qr-scanner
From:
ionic cordova plugin add cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
To:
npm install cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
npx cap sync
https://ionicframework.com/docs/native/qr-scanner
I have been trying to use the ionic-native plugins provided by Ionic 3. When I read the install instructions, there are always 2 command lines instead of one.
ionic cordova plugin add cordova-plugin-camera
npm install --save #ionic-native/camera
If my memory serves me right, only a single command similar to ionic plugin add somepluginhere will get the job done in the old days.
What are the differences here?
The difference is they are different packages.
ionic cordova plugin add
This command will download the cordova plugin - in this case, camera and set the config.xml , package.json, save in plugins folder and set it for each of your platforms.
Ionic leverages the cordova CLI to do this.
ionic-native
Ionic Native is simply a wrapper to the corresponding plugin.
npm install --save #ionic-native/camera
It installs the package #ionic-native/camera to your node-modules folder and sets that in package.json and nothing more.
This wrapper allows you to inject the corresponding cordova plugin as an Angular provider wherever you need instead of trying to declare the global variable and other workarounds.
To be more specific, the plugins are: #ionic-native/estimate-beacons and #ionic-native/ibeacon. I have followed all the steps and also add the plugin into my app's module. This also happens once to my #ionic-native/ble.
Here are the console logs:
and:
Am I missing any step? I'm getting very frustrated since the project is stuck right at the beginning.
P/s: I'm using IONIC and Cordova ' newest version. I follow the docs to install the plugin:
$ ionic cordova plugin add cordova-plugin-estimote
$ npm install --save #ionic-native/estimote-beacons
then
After installing a plugin’s package, add it to your app’s NgModule.
After that, I DO see the plugin shows up in the plugins folder. All finished but everytime got asked to install the plugin!!!
I installed Cordova and Ionic Native plugins into the ionic3 project.
But I need to remove only that specific Cordova and Ionic Native plugins from the project completely. (With its dependencies like npm).
Is there any proper way to do that?
Appreciate any kind of your help.
Thank you!
I just refer their document here.
Example:
To install a plugin we are using following way.
ionic cordova plugin add <plugin-name>
(ionic cordova plugin add cordova-plugin-dialogs)
npm install --save #ionic-native/<npm-name-of-plugin>
(npm install --save #ionic-native/dialogs)
To Uninstall the plugin just need to revert above things back as bellow
ionic cordova plugin remove <plugin-name> or ionic cordova plugin rm <plugin-name>
(ionic cordova plugin remove cordova-plugin-dialogs) or (ionic cordova plugin rm cordova-plugin-dialogs)
Finally uninstall the associated Ionic Native package(s) from npm
npm uninstall --save #ionic-native/<npm-name-of-plugin>
(npm uninstall --save #ionic-native/dialogs)
The --save flag will remove the project's package.json entry for that plugin
Doing above things helps me to remove plugin completely with its npm dependencies from the project. Hope this will useful to someone else
You can use the following command to remove
ionic cordova plugin rm <plugin name>
Example :
ionic cordova plugin rm cordova-plugin-camera
Please check the similar type of question to here.
Also please check the documentation of plugin commands from here.
Hope this will help you!!
please make sure that you also run npm uninstall after ionic cordova remove skipping this may lead to serious consequences like for instance the BUILD is successful but some of features in the App fails in the runtime complaining the plugin is missing, what must have happened in this case is re installation must have silently failed as the plugin source still exists due to not performing npm uninstall, such mistakes do happen while migrations, upgrade to new CLI. In my case InAppPurchase2 plugin did not work, payments stopped working :(, something quite miserable isn't it..hope the lesson helps someone out there..
Try below
ionic cordova plugin remove <PLUGIN_NAME> --no-interactive
READ MORE
Hope this helps