2011-04-27 6 views
1

나는이 플러그인을 작동 시키려고 노력하고 있지만 저에게는 효과가 없습니다.Phonegap 시스템 알림 플러그인

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

나는 메신저는 자바 스크립트 파일에서 플러그인을 호출 잘못된 일을 생각한다. 이것은 내가 지금까지 가지고있는 것이다.

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

}); 

내가 뭘 잘못하고 있니?

+0

"onBackground"를 명시 적으로 호출하기 때문에 앱이 포 그라운드에있을 때 시스템 알림을 받고 싶다고 가정합니다. 콘솔 로그를 작성해주세요. 알림 방법과 그것이 호출되는지 확인하십시오. 또한 README에서 말하는 모든 것을 수행하고 있는지 확인하십시오. – Sailesh

답변

0

일부 조정을 마친 지금 작동 중입니다.

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('', '', ''); 
관련 문제