Forum Xamarin.Forms

Prompt user to change battery optimization settings - Android

Hi,
I am looking for some solution for disabling battery optimization setting for my application.
When user install app first time and Battery optimization is enable, App should prompt custom popup (Popup text based on user language), and after clicking on button, It should navigate to setting page, there user can disable battery optimization.
Same setting app should save, And should not ask again and again.

Best Answer

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    What is your app doing to drain the battery so much that you have the need to do this?
    We're doing constant GPS monitoring of the vehicle plus screen at 80% and don't need to. Makes me wonder.

  • rajshekhar_Trajshekhar_T Member ✭✭

    We are using third party lib "Glympse" for agent live location tracking, When user launch Agent location tracking from our app and stay long with tracking window, Operational system automatically remove app from background.

  • rajshekhar_Trajshekhar_T Member ✭✭

    Hi LeonLu,
    Thanks Man, Your solution has resolved my problem

  • PetiPeti Member ✭✭

    Great example, something to bear in mind is you need to check your app is on the acceptable use-cases list, otherwise Google Play won't approve you.

    Basically unless you're doing something with peripherals, e.g. iBeacons - forget it.

  • weggiebudzweggiebudz Member ✭✭

    Hi, is there any way that it will go directly to the apps? Thank you

  • tareqelzoubitareqelzoubi Member ✭✭

    One of my apps just got removed from the Play Store because it declared the "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" permission in its manifest.

  • ledragonledragon Member ✭✭✭

    @ClintStLaurent said:
    What is your app doing to drain the battery so much that you have the need to do this?
    We're doing constant GPS monitoring of the vehicle plus screen at 80% and don't need to. Makes me wonder.

    Hi there,

    Are you using foreground service for this? I have a requirement for the same but I also need to know and send response to the backend server if the OS kills the process.

    Have you any suggestions?

    Thanks in advance

Sign In or Register to comment.