简体   繁体   English

即使应用未运行,每分钟也会在特定时间显示Phonegap通知

[英]Phonegap display notification on specific time every minute even the app is not running

I'm creating an app in Phonegap Android and using LocalNotification plugin from git to show the notification. 我正在Phonegap Android中创建一个应用程序,并使用git中的LocalNotification插件显示通知。 Now I have the code: 现在我有了代码:

  function onDeviceReady(){
    window.plugin.notification.local.add({
            id:      1,
            title:   'alert',
            message: 'Mesage',
            repeat:  'minutely',
    });
  }

With this code, the message will display every minute, but when I go to Setting then Force to Stop, the notification will not appear. 使用此代码,消息将每分钟显示一次,但是当我转到“设置”然后“强制停止”时,将不会显示通知。
In the future,I want to show a notification in 7:00AM everyday even the app running or not. 将来,我希望每天早上7:00都显示一条通知,即使该应用程序是否运行也是如此。
Any advise for me to make notification appear when the app is not running. 当应用未运行时,任何有关通知我的建议都会出现。 thank you for your help! 谢谢您的帮助!

You can't. 你不能 Force stop makes the app stop permanently. 强制停止会使应用程序永久停止。 All alarms and receivers registered in the app will be turned off. 在应用程序中注册的所有警报和接收器将被关闭。 That's the purpose of force stop- to turn the app completely off. 这就是强制停止的目的-完全关闭应用程序。 If you want the app to continue in the background, don't force stop it. 如果您希望该应用在后台继续运行,请不要强行停止它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM