问题描述
我正在实施GCM推送通知服务,因为我使用了服务类来扩展我的课程。所以我实现的服务不断在后台运行。但是,当应用程序 空闲很久 时,我没有收到任何通知。它仅适用于应用程序在堆栈中运行。
I am implementing GCM push notification service, for that I used Service class to extend my class. So Service that I implemented is running in background continuously. But I am not getting any notification when app is idle for long time.It is working only for, when app is running in stack.
我知道,当应用程序从Stack关闭时,我们无法获得通知。
I know, we cannot get notification when App is close from Stack.
当应用程序长时间未运行时,请帮助我获取通知(如Whatsapp或Gmail)。
Please help me to get notification when app is not running for long time (like Whatsapp or Gmail).
我使用了 IntentService ,但它只在应用程序运行时(前台或后台)运行。
I used IntentService but it is working only when app is running(foreground or background).
推荐答案
请阅读在其用完时停止。
Read this, IntentService stops itself when it runs out of work.
以及关于通知它可能随时出现,因为您需要放置BroadcastReceiver。
and about notification it may be comes at any time for that you need to put BroadcastReceiver.
创建服务按照扩展服务分类:
这篇关于当App不再运行时,GCM推送通知不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!