Phonegap system notification plugin
I'm trying to get this plugin to work but it wont work for me.
https://github.com/saileshmittal/phonegap-system-notification-plugin
I think im doing something wrong with calling the plugin in the Javascript file. This is what i have so far;
var not_title = 'MELVIN';
var not_text = 'Zou dit werken?';
var not_tText = 'of toch niet?';
navigator.systemNotification.onBackground();
//navigator.systemNotification.onForeground();
navigator.sy开发者_StackOverflowstemNotification.createStatusBarNotification(not_title, not_text, not_tText);
//navigator.systemNotification.updateNotification(not_title, not_text, 1);
this is what is have in SystemNotification.js in the bottom of it;
PhoneGap.addConstructor(function () {
if (typeof(navigator.systemNotification) == "undefined") {
navigator.systemNotification = new SystemNotification();
navigator.systemNotification.touch(); //this ensures that the plugin is added when phonegap kicks off
}
//PhoneGap.addPlugin("systemNotification", new systemNotification());
PluginManager.addService("systemNotification", "com.SystemNotification.SystemNotification");
});
What am I doing wrong?
Got it working now after some adjustments;
PhoneGap.addConstructor(function () {
PhoneGap.addPlugin("SystemNotification", new SystemNotification());
PluginManager.addService("SystemNotification", "com.phonegap.plugins.SystemNotification.SystemNotification");
window.plugins.SystemNotification.touch();
});
window.plugins.SystemNotification.onBackground();
window.plugins.SystemNotification.createStatusBarNotification('', '', '');
精彩评论