Friends,
I’m having another difficulty with the Ionic Package, and hope you can help me again.
We are using in our application the plugin to login with Facebook, however we had to make a fork of this plugin and change some things in its native source code for IOS.
So in our Ionic project we added this plugin by pulling it directly from our repository in github to use our custom version.
When we run a local build using the command: Ionic cordova build ios
The plugin behaves as expected within the application by logging into Facebook successfully.
On the other hand, when I try to build in production through the Ionic Package, using the command: Ionic package build ios --release --prod --profile=beta
The app simply comes without the plugin installed. I do not know what happens, but when I try to login with Facebook after generating the build through the Ionic Package, nothing happens. I installed a tool to check the application log (weinre) and the application simply ignores that the plugin exists. No error appears, but also no progress in the script that logs Facebook. Just stand there.
What could be happening? What is the compatibility of the Ionic Package to use custom plugins pulled directly from the github repository?
Is there any special parameter that should be passed to Ionic Package at the time of the build?
How does your config.xml and package.json refer to the plugin?
Normally the plugins “clobber” a global object into JS namespace that you then just “call” in the dev tools console, e.g. “window.cordova.plugins.foo” or similar. Try that with a plugin that is working and yours to check.
Ok, I changed the category of the topic to reflect that it is a Ionic v1 project.
Hmm, is this the only location in your package.json where it appears? I am not sure if Ionic Package uses package.json or config.xml to download plugins - and right now it looks like only your config.xml includes your custom path to the plugin.
That would be one solution.
You could also uninstall the plugin, see via git what changed, and add it again. Might be better to understand what is going wrong.
It did not work. I have now tested the build done by Ionic Package with the package.json changed manually including the path of the plugin repository, and still nothing works.
Actually this behavior is interesting, since if I do a local build to run in the emulator and a connected device, the plugin works.
The problem seems to be exactly in the build done there at the Ionic …
Have you done a new checkout of your project and run npm install and ionic cordova prepare to see if the plugin is installed correct locally from a fresh checkout?