Android Question Bakground service not working

Discussion in 'Android Questions' started by Kiran Raotole, Aug 28, 2018.

  1. Kiran Raotole

    Kiran Raotole Active Member Licensed User

    Hii, I make background service app which show notification but it work in some device and not work in some devices.
    Its work in Xiaomi MI A1 and not work in Redmi note 4.

    I aslo use region service attributes == #StartAtBoot: True
     
  2. KMatle

    KMatle Expert Licensed User

    Do you mean Firebase Messaging? If yes: The service is started automatically (by Android/Google FCM service). No extras needed. See the example. Nothing else is needed. How do you send the messages and what kind of messages are you sending (data/Notofication/mixed). Check the energy savings on that device, too. On some devices "unknown apps" (= not in a whitelist like WhatApp) are not allowed to run in the background by default (you can change that manually). I had this on a Huawei P8 which made me mad until I found out.
     
  3. Kiran Raotole

    Kiran Raotole Active Member Licensed User

    no I'm not using firebase messaging service, I'm using background service and it php code.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It will not work unless your service is a foreground service.
     
  5. Kiran Raotole

    Kiran Raotole Active Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice