[英]Notification in Phonegap While App is not running
I am working on an app with PhoneGap on android where the user will get messages every now and then bringing them to one of the pages on the app. 我正在使用Android上的PhoneGap应用程序,用户将立即获取消息,然后将其带到应用程序的其中一个页面。 I've looked at a few possibilities but haven't found any simple way to do this. 我已经看了几个可能性,但没有找到任何简单的方法来做到这一点。 Can I use the built in Notification on the Phonegap API to do this? 我可以使用Phonegap API上的内置通知来执行此操作吗?
I have found a few good ways to do push notifications like thisw: http://www.pushwoosh.com/programming-push-notification/android-push-notification-for-phonegap/ but I want the notification to be coming from the app itself with the time determined by a built in timer. 我发现了一些推送通知的好方法,例如: http ://www.pushwoosh.com/programming-push-notification/android-push-notification-for-phonegap/但我希望通知来自应用程序本身的时间由内置计时器确定。
Thanks! 谢谢!
You can't, not in Phonegap anyway. 不管怎样,你不能,而不是Phonegap。 If the user leaves the app with the Home button, then the code is still running (until it gets killed when memory gets low). 如果用户使用Home按钮离开应用程序,则代码仍在运行(直到它在内存变低时被杀死)。 But if the user exists with the back key, the app dies. 但如果用户存在后退键,则应用程序将死亡。 See here: Creating an Android Service with Phonegap? 请参阅此处: 使用Phonegap创建Android服务? (Have phonegap app run even when closed) (即使关闭,也可以运行phonegap app)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.