How to implement proguard in cordova plugin? - cordova-plugins

I am creating a plugin in cordova. I want to use progaurd to secure my plugin code. How I can implement progaurd in cordova plugin.

Add
proguard.config=proguard-android-optimize.txt
in project.properties file of your plugin.
Then create and add proguard-android-optimize.txt in same folder of project.properties
and build with release target.
You can find more information about proguard config file here.

Related

ionic: add own cordova plugin

I modified an existing cordova plugin and want to integrate it now into my application.
I already created a link to my source directory
cordova plugin add --link ~/path/to/plugin
but now I can not find my plugin in my project. I suggest, that the plugin needs to be build?
Is it needed to modify my package.json?
Add the plugin to project:
ionic cordova plugin add [plugin]
Documentation
Install and save the plugin:
npm install --save [plugin]
Example
This is related to stackoverflow/questions/30345035
Since you modify existing plugin there is possibility that you didn't modify it right. Also there is possibility that plugin is not working for specific platform version.
If you are looking to add your own cordova plugin in Ionic v2 here can be your solution.
If you have exported your module / plugin like
module.exports = new YourPluginJavaClass();
then you will be able to use it in your Ionic application as
(window as any).YourPluginJavaClass.yourFunction();
Please see this link as well
Hope this helps.

Xcode 7 can't detect the customize plugin class of ios cordova project

I coded a iOS plugin for cordova project. My project can run well with My Plugin when i put Plugin Class into Compile Resource of Xcode.
But i have a request which must packed My Plugin into module.framework.
I added module.framework into Link binary with Library of Xcode and link in Frameworks Search Path (Build setting). =>My project can't detect my plugin.
I try call function in module.framework, it's Ok. But run Cordova project has error that can not found plugin in module.framework.(Config.xml already added Plugin Class)
If you have any idea, please help me.
Thank so much!

How to add plugins for ios in phonegap?

I am new to phonegap.
Using phonegap app I have created new project.
Now I like to use this project in xcode (7.2.1) is it possible?
What is the best way to develop app in phonegap for various plugin ,I was googled and heard about coredova but can't understand exact needed .
For IOS Try this to add any new Plugin.
Go to your Created Project Directory in Mac CLI.
Then do this.
If you haven't added IOS Platform then run below command.
cordova platform add ios
Then build your whole project with below command.
cordova prepare ios
Then to add plugin run below command.
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
Here take whatever plugin you want to install.
Make sure you connected with internet while installing plugin.
Now I like to use this project in xCode (7.2.1) is it possible?*
Yes it is possible, Read this article
What is the best way to develop app in phonegap for various plugin
I am assuming you are asking how to add different plugins?
Create your APP with the PhoneGap Interface (You already did)
Go to the www folder where you stored the PG build files and look for your config.xml, then you will see a section where a few plugins already exists. You can add additional ones by just simply copying and pasting the below XML syntax (Battery Status Plugin), example:
<plugin name="cordova-plugin-battery-status" spec="1.1.0" source="pgb" />
Reference this article for a comprehensive list of PhoneGap's plugins:
https://build.phonegap.com/plugins
Alternatively, you can add them through the Command Line interface (See the first answer to your question)

add new plugin to phonegap 3.4

I'm trying to add new plugin (https://github.com/xu-li/cordova-plugin-wechat) to my phonegap project. but I get stuck on the installation number 1.
For number 1, they said Add wechat lib to your project. Don't forget to add the "URL Type". but I don't know where should I put library files to? which folder? because I know that every time I use cordova build ios command, it will generate new project files in platforms/ios. Should I put library files after generated?
Thank you.
Make sure you have install the required SDK. use command $ cordova platform add ios. Now add the generated files in the project folder. See if this works. Add Cordova command script file if required.

Where can we place config.xml in IOS phone gap?

Hi I am new to IOS and Xcode. Can we use config.xml in IOS xcode? If we are using where can we place the config.xml. While creating my project I did not get config.xml. Is it will be a problem?
Using the latest versions of cordova tipically update the required files (config.xml) for you when you use the CLI with command
Cordova plugin add
The documentation explain specific tweaks to the config.xml
http://cordova.apache.org/docs/en/3.1.0/config_ref_index.md.html#The%20config.xml%20File
From the doc
For projects created with the Cordova CLI (described in The Command-line Interface The Command-line Interface), this file can be found in the top-level www directory. Using the CLI to build a project regenerates versions of this file in various subdirectories within platforms .Ifyou usetheCLI to create a project, but then shift your workflow to an SDK, the platform-specific file serves as a source.

Resources