简体   繁体   English

Phonegap中的通知当应用程序未运行时

[英]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.

相关问题 Phonegap应用程序打开时,推送机器人处理通知 - Pushbots handle notification while Phonegap app is open 即使应用未运行,每分钟也会在特定时间显示Phonegap通知 - Phonegap display notification on specific time every minute even the app is not running Android:phonegap / cordova:在应用运行时切换全屏模式 - Android: phonegap/cordova: switch full screen mode while app is running 在运行Phonegap android应用时获取类型错误结果表达式 - Getting Type Error Result expression while running Phonegap android app Phonegap通知在Phonegap开发人员Android应用程序中不起作用 - Phonegap Notification not working in phonegap developer android app Phonegap App在后台运行? - Phonegap App running in background? 在Android应用处于前台模式时获取推送通知,但在应用未运行或处于空闲模式时无法获取通知 - Getting push notification while Android app is in foreground mode but unable to get notification while app is not running or idle mode API> 25 中的前台服务在应用程序运行时是否需要通知(可见) - Is notification mandatory while app is running(visible) for the foreground service in API>25 如何在应用程序运行时获取或检测 FCM 通知? - How can i get or detect FCM notification while app running? 在应用未运行时设置小通知图标背景颜色 - Setting small notification icon background color while app is not running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM