Problem including a custom plugin in the project

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    6 posts
    Member since:
    Jan 2013

    Posted 08 Oct 2015 Link to this post

    So I have found this plugin:

    https://github.com/cranberrygame/cordova-plugin-pushnotification-parsepushnotification

    and I have imported it as it's ​written here

    However, the object window.parsepushnotification is still undefined inside device ready.

    document.addEventListener('deviceready', function () {
         navigator.splashscreen.hide();
         app = new kendo.mobile.Application($(document.body), { initial: "#home" });
             
         window.parsepushnotification.setUp(applicationId, clientKey);
     
        window.parsepushnotification.onRegisterAsPushNotificationClientSucceeded =  function() {
            alert('onRegisterAsPushNotificationClientSucceeded');
        };
        window.parsepushnotification.onRegisterAsPushNotificationClientFailed = function() {
            alert('onRegisterAsPushNotificationClientFailed');
        }; 
    }, false);​

    I am not including any js file, but since plugin.xml contains <js-module> tag I dont see what is wrong, and why is object undefined. 

     

    <js-module src="www/parsepushnotification.js">
            <clobbers target="window.parsepushnotification" />
    </js-module>

     

     Thanks

     

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Oct 2015 Link to this post

    Hello Patrick,

    Do you try testing the app in the Simulator or the Companion App? If so, then this would be the expected behavior since Custom Plugins are not supported in this case. You can refer to :
    Limitations of the Companion App
    Limitations of the Device Simulator

    In order to test it, you need to deploy your app directly on a device using the Build or Build and Deploy options.You can also refer to the topic on Running Apps on Devices.

    If this is not the case, then may I ask you to share some additional information:
    - have you followed all the configuration guidelines?
    - would it be possible for you to share with us the specific app as you have configured it?

    Regards,
    Dimitrina
    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