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

Problem including a custom plugin in the project

1 Answer 28 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Patrick
Top achievements
Rank 1
Patrick asked on 08 Oct 2015, 01:07 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 13 Oct 2015, 01:05 PM
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.

 
Tags
General Discussion
Asked by
Patrick
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or