Android Question sticky service for gcm

ArminKH

Well-Known Member
Hi
I want a service 4 gcm which is always running my searches over this forum came up 2 solution
1-Use sticky service + StartServiceAt
2-Use service.startforground
As i understand service.Startforground is better but i dont want any notification
I want just use a service to listen to google receive intent for new messages but some times after hours or when i use some apps such as cleanmaster to clear ram my service killed and then the device cant listen for incoming push messages
Please suggest the best way to have an always online gcm service
Tnx
 

ArminKH

Well-Known Member
You do not need a sticky service to handle GCM messages. The service will start automatically when a message arrives.
Are u sure?if yes please reproduce following steps
1.Make a gcm service
2.Start app and register device to gcm service
now you can send message to device
3.now close your app completly and install clean master app and configure properly for handle background tasks
4.clear ram by using clean master
5.Send push message to device
Now you can see not any message arrived to your device
6.Try to register again your device then you can see your message which you sent on previous step arrived to your device
..........
If you cant reproduce then i will attach a video shot
Thank u
 
Upvote 0

ArminKH

Well-Known Member
Yes, I'm sure.

If the user explicitly kills the app then Android will not start the process until the user explicitly starts it again.
Search the site for static intent filters.
thanx erel
but why u are impatient today?:D:D
Ok Damet Garm Pesaaaaaaaaar
 
Last edited:
Upvote 0
Top