Phonegap 3.5.0 - plugins not working after unloading for build

I just got started with Phonegap and am using the latest version (3.5.0).

I installed the app using the CLI and I am having plugin issues after uploading to build.phonegap.com .

I followed all the steps on the CLI page above to create a simple application that simply notifies a notification when the device boots.

Example:

navigator.notification.alert(
        'Welcome to the app',  // message
         okay,                  // callback
        'Welcome',             // title
        'Continue'             // buttonName
);

      

This works fine in the emulator, however, when I upload the app to the PG assembly (via a zip file) and upload it to the device, there are no notifications.

I notice when I load my plugins tab app it says "There are no plugins in this app." which i think is the problem.

I am using the following to add plugins locally: cordova plugin add org.apache.cordova.dialogs

Do I need to do something else to get them as part of an assembly?

+3


source to share


2 answers


I suggest you read the documentation on creating phone bookmarks .

You have to put plugins in your config.xml with <gap:plugin name="plugin.name" />

in order to use it with build and you can only use certified plugins present at https://build.phonegap.com/plugins

So, for your example, you would add the following line to your config.xml:

<gap:plugin name="org.apache.cordova.dialogs" />

      



Using CLI, for example:

cordova plugin add org.apache.cordova.dialogs

      

does not add plugins to your xml configurator, you need to do it as above and also to work with assembly.

Note. As of cordova 3.4, the config.xml file is no longer generated in the www folder, so you have to move it yourself. When uploading to build, you only need to zip the www folder containing config.xml, index.html, js, css, img etc

+9


source


I used the following to create the application:

cordova create hello com.example.hello HelloWorld

      

for some reason this created a config.xml file at the top level and not in my WWW folder (where it should be) and it's also worth noting that when installing plugins via the CLI like:

cordova plugin add org.apache.cordova.dialogs

      



You still need to add the plugin to config.xml i.e.

<gap:plugin name="org.apache.cordova.dialogs"/>

      

Otherwise they won't apepar in the plugins tab in build.phonegap.com

+1


source







All Articles