This is a migrated thread and some comments may be shown as answers.

Error install pluguins

4 Answers 58 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Junior
Top achievements
Rank 1
Junior asked on 26 Jun 2017, 04:34 PM
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.


 

4 Answers, 1 is accepted

Sort by
0
Garo
Telerik team
answered on 29 Jun 2017, 12:15 PM
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.

 
0
Junior
Top achievements
Rank 1
answered on 29 Jun 2017, 12:27 PM
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 ....
0
Junior
Top achievements
Rank 1
answered on 29 Jun 2017, 12:27 PM
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 ....
0
Kaloyan
Telerik team
answered on 04 Jul 2017, 01:04 PM
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.

 
Tags
Apache Cordova
Asked by
Junior
Top achievements
Rank 1
Answers by
Garo
Telerik team
Junior
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or