Install ionic native plugin from github


#1

I need to deploy (via ionic pro) a version of my app that uses and un-released ionic native plugin. I can;t seem to figure out how to install a namespaced plugin (@ionic-native/firebase) via a git url. Is that possible? The issue is there is a feature in the master branch that has not been released yet and it fixes an issue in my app. If I use ionic deploy, it installs what’s in package.json, and it’s not installing plugins from the git url of ionic-native


#2

You can specify a git repository in your package.json,

e.g.

"dependencies": {
  "my-cool-package": "https://github.com/homerours/cordova-music-controls-plugin.git"
}

#3

I understand that, but ionic native is packaged very uniquely. It uses namespacing, as well as individual packages for each plugin, and these are turned into npm packages using some special scripts.


#4

Cordova File Plugin

To add the plugin to your project:

ionic cordova plugin add cordova-plugin-file
npm install --save @ionic-native/file

To remove the plugin from your project:

ionic cordova plugin rm cordova-plugin-file
npm uninstall --save @ionic-native/file

You can also use --link to link to a local copy of a repo, for example:

To clone the project:

git clone https://github.com/ato-team/cordova-plugin-abrakm-sdk.git

To add the plugin to your project:

cordova plugin add --link ../cordova-plugin-abrakm-sdk

To remove the plugin from your project:

cordova plugin rm cordova-plugin-abrakm-sdk

To check your project’s plugins:

ionic cordova plugin ls

You should see output like:

cordova-plugin-abrakm-sdk 1.0.0 "Abrakm SDK Cordova Plugin"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-scanbot-sdk 1.3.0 "Scanbot SDK Cordova Plugin"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

#5

As I said in my original post, I’m trying to install an ionic-native plugin from GITHUB. The feature I need is not in a released npm version of ionic native. Is no one reading the original post? The feature is only in the master branch of the ionic native github repo.


#6

This certainly isn’t the best solution, but the best one I have to offer is to fork the repository and push up the dist folder.


#7

https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md#testing-your-changes this might help