Android Question sticky service for gcm

Discussion in 'Android Questions' started by ArminKH, Jul 8, 2015.

  1. ArminKH

    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You do not need a sticky service to handle GCM messages. The service will start automatically when a message arrives.
     
    ArminKH likes this.
  3. ArminKH

    ArminKH Well-Known Member

    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
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
    ArminKH likes this.
  5. ArminKH

    ArminKH Well-Known Member

    thanx erel
    but why u are impatient today?:D:D
    Ok Damet Garm Pesaaaaaaaaar
     
    Last edited: Sep 3, 2015
  6. Erel

    Erel Administrator Staff Member Licensed User

    Sorry but I didn't mean to sound harsh. Just answered the question :)
     
    ArminKH likes this.
Loading...