Плагин для уведомлений PhoneGap - PullRequest
1 голос
/ 27 апреля 2011

Я пытаюсь заставить этот плагин работать, но он не будет работать для меня.

https://github.com/saileshmittal/phonegap-system-notification-plugin

Я думаю, что я делаю что-то не так с вызовом плагина в файле Javascript.Это то, что у меня пока есть;

        var not_title   = 'MELVIN';
    var not_text    = 'Zou dit werken?';
    var not_tText   = 'of toch niet?';

    navigator.systemNotification.onBackground();
    //navigator.systemNotification.onForeground();
    navigator.systemNotification.createStatusBarNotification(not_title, not_text, not_tText);
    //navigator.systemNotification.updateNotification(not_title, not_text, 1);

это то, что есть в SystemNotification.js внизу;

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");

});

Что я делаю не так?

1 Ответ

0 голосов
/ 01 мая 2011

Работает теперь после некоторых настроек;

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('', '', '');
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...