Error install pluguins

5 posts, 0 answers
  1. Junior
    Junior avatar
    3 posts
    Member since:
    Feb 2011

    Posted 26 Jun Link to this post

    good evening,

      I already have this problem for months and skirting ...

     I would like to add non-telerik plugins.

     Plugins cordovan ...

     I have read the procedure several times but I have the following error:

       Module.exports

      The problem occurs for any plugin that I try to add that is not checked by you. This is impacting on keeping the app on telerik .. I can only use vcs plugins ...

     What I do to install the plugin:
     1- Down the Zip
     2-Extract in the plugins folder
     3- I go to the plugin.xml file and get the path of the js file that should be added to my application.
      4- Copy the file to my plugin .js application and add it to my index after cordova.js
      5- in the event whereviceread the error plugin.

     I noticed that the file cordova_plugins.js does not have the modules added ...

     Please, I must urgently resolve this.

     I'm sending some attachments.

     The image plugin is p notification (before you tell me to use the one I do not want!) I want to learn how to install non-Telerik plugins.
     If it is not possible, I will be terminating the account by limitation.


     
  2. Garo
    Admin
    Garo avatar
    136 posts

    Posted 29 Jun Link to this post

    Hello Junior,

    Based on the provided images it seems that you are adding the phonegap-plugin-push plugin through bower. Cordova has a specific way to add plugins to the project that does not involve bower or referencing plugins to the index.html file. In AppBuilder we use a similar approach which is described in our documentation.

    In general, you have to download the phonegap-plugin-push from GitHub and then add it to your project by following the steps outlined in the documentation link provided above. Once you have included the plugin to your app, you will directly gain access to the API of the plugin (for example, push.on) after the deviceready event has fired. There is no need to reference the plugin in the index.html file.

    I hope this helps.

    Regards,
    Garo
    Progress Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Junior
    Junior avatar
    3 posts
    Member since:
    Feb 2011

    Posted 29 Jun in reply to Garo Link to this post

    I'm good morning.
       Is there any change in the xml file of the plugin? I've tried to do it this way that you mentioned without success.
    1- Extract the zip in the plugin folder
    2- in deviceready should the plugin already be working? If this is not what happens, it only works by copying the js file to the folder of my js project and referencing it in index.html and even then giving it a new it informs that no .init is not function ....
  4. Junior
    Junior avatar
    3 posts
    Member since:
    Feb 2011

    Posted 29 Jun in reply to Garo Link to this post

    I'm good morning.
       Is there any change in the xml file of the plugin? I've tried to do it this way that you mentioned without success.
    1- Extract the zip in the plugin folder
    2- in deviceready should the plugin already be working? If this is not what happens, it only works by copying the js file to the folder of my js project and referencing it in index.html and even then giving it a new it informs that no .init is not function ....
  5. Kaloyan
    Admin
    Kaloyan avatar
    877 posts

    Posted 04 Jul Link to this post

    Hi Junior,

    Yes, the plugin should be loaded and its API accessible on deviceready after you have imported it. However, I just tested with the latest version of the Phonegap Push plugin (v2.0.0-rc5) and found that the PushNotification object was indeed undefined when tested on devices. Googling about this, I cam across this thread which makes me think that there is an issue in the release candidate version of the plugin. To make sure that this is the case, I tested with an older and officially released version (v1.10.5) and the above problem wasn't present there.

    This said, I prepared a sample project in which the Phonegap Push plugin (v.1.10.5) works on deviceready as expected. You will find it attached to my reply and here are the steps I followed:
    1. I created a new Cordova project inside Telerik Platform
    2. Next, i downloaded the latest official version of the plugin from here (v1.10.5)
    3. I imported the archive via the Import Plugin feature in AppBuilder
    4. I added the following code on deviceready:
      try {
         var push = PushNotification.init({
            android: {
            },
            ios: {
               alert: "true",
               badge: true,
               sound: 'false'
            },
            windows: {}
         });
      }
      catch(err) {
         alert(err.message);
      }
    5. Finally, I built the app in the cloud as an application package and deployed it on actual devices. When started, the init fuction executed as expected.

    I hope this helps.


    Regards,
    Kaloyan
    Progress Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top