2

I develop an application that needs to send a notification with FCM.

But when I installed it on the Asus device when app closed (killed) data was not received in service.

I realized Asus and Huawei and some other vendors have auto start setting to save battery and user must allow to my app that have access background service.

Is it possible to run this service without permission from the user?

Some application does this! for example, Telegram.

AmirNorouzpour
  • 1,039
  • 1
  • 9
  • 23

1 Answers1

2

Unfortunately you cannot whitelist your app in Auto Start / Auto Protect for ASUS and Huawei devices without user intervention.

The best course of action is to display a dialog in case the android.os.Build.MANUFACTURER is huawei or asus and open up the Auto Start / Auto Protect page to make things easier for the user:

"Protected Apps" setting on Huawei phones, and how to handle it

Elad Nava
  • 6,524
  • 2
  • 36
  • 59