2016-09-30 87 views

回答

0

取決於你想要做什麼,你可能需要調整插件了一下。 爲了保持通知到位,我假設你已經設置了持續時間:當你計劃它時是否爲true?

如果您正在尋找在Android平臺上,你可以嘗試這樣的:

1)安裝插件到一個新的文件夾或臨時項目,並看看「ClickActivity.java」

1.A)從項目

2)修改代碼以禁止或調整通話,你需要它刪除插件的現有版本:

public class ClickActivity extends de.appplant.cordova.plugin.notification.ClickActivity { 
 

 
    /** 
 
    * Called when local notification was clicked by the user. 
 
    * 
 
    * @param notification 
 
    *  Wrapper around the local notification 
 
    */ 
 
    @Override 
 
    public void onClick(Notification notification) { 
 
\t \t 
 
\t \t 
 
     LocalNotification.fireEvent("click", notification); 
 

 
     super.onClick(notification); 
 

 
     if (notification.getOptions().isOngoing()) 
 
      return; 
 

 
     String event = notification.isRepeating() ? "clear" : "cancel"; 
 
     LocalNotification.fireEvent(event, notification); 
 
    }

3)從您的自定義目錄

cordova plugin add de.appplant.cordova.plugin.local-notification --searchpath your-custom-path 

重新安裝插件的版本,我需要的東西,我只是抑制原電話 - 俗氣,我知道,但我需要的是一個通知。就像你說的,我不希望它把應用拉到前臺。

這會做你需要的嗎?

相關問題