패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.1.2

disable_battery_optimization

배터리 최적화를 확인하고 비활성화하는 Flutter 플러그인입니다. 또한 미, 샤오미, 삼성, 옵포, 화웨이, 온플러스 등 장치에서 최적화를 비활성화하기 위한 사용자 지정 단계도 표시합니다

Android
30일 다운로드
1.4만
좋아요
129
Pub 점수
150

패키지 설치

flutter pub add disable_battery_optimization

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

안드로이드 기기에서 배터리 최적화를 확인하고 비활성화하는 플러터 플러그인으로, 백그라운드 실행이 필요한 앱에 특히 유용합니다. 샤오미, 삼성, 옵포, 화웨이, 원플러스와 같은 인기 브랜드를 위한 맞춤형 지침을 제공하여 사용자가 수동으로 설정할 수 있도록 안내하며, 앱 성능이 중단되지 않도록 도와줍니다. 이 플러그인은 OS가 앱 활동을 제한하지 않도록 하여 위치 추적, 푸시 알림, 백그라운드 동기화 등의 서비스 신뢰도를 높입니다.

사용 사례

  • 백그라운드 작업 실행
  • 백그라운드에서의 위치 추적
  • 푸시 알림의 신뢰성
  • 장기간 데이터 동기화
  • 앱 성능 최적화
  • 배터리 수명 관리

주요 기능

  • 기기별 최적화 가이드
  • 자동 배터리 최적화 확인
  • 주요 안드로이드 브랜드 지원
  • Flutter와의 간단한 통합
  • 사용자 지침 지우기
  • 크로스 디바이스 호환성

적합한 대상

  • 지속적인 백그라운드 프로세스가 필요한 앱
  • Android OEM를 대상으로 하는 개발자
  • 신뢰할 수 있는 포그라운드 실행이 필요한 서비스
  • 실시간 업데이트가 가능한 모바일 앱
  • 기업 또는 유틸리티 애플리케이션

고려 사항

  • Android 플랫폼만 필요
  • 일부 단계에서는 사용자 상호작용이 필요합니다
  • 목록된 안드로이드 기기 제조업체에 한정
  • 권한 요청이 필요할 수 있습니다
  • iOS 장치에는 적용되지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

disable_battery_optimization

Flutter plugin to check and disable battery optimizations. Also shows custom steps to disable the manufacturer specific optimizations on devices like mi, xiaomi, samsung, oppo, huawei, oneplus etc


Auto start
bool isAutoStartEnabled = await DisableBatteryOptimization.isAutoStartEnabled;

This will return true, for the devices which doesn't support auto start configuration as well for the devices on which, user has clicked on positive action for the auto start configuration dialog.

await DisableBatteryOptimization.showEnableAutoStartSettings("Enable Auto Start", "Follow the steps and enable the auto start of this app");

This will show a dialog with steps to enable auto start permission on the current device (if it's available)

Note: We cannot determine if the user has actually enabled the auto start permission or not. We can only show a dialog with the steps to enable.


Android Battery Optimization
bool isBatteryOptimizationDisabled = await DisableBatteryOptimization.isBatteryOptimizationDisabled;

This will return true, only if the user has disabled the 'native' battery optimization for this app.

await DisableBatteryOptimization.showDisableBatteryOptimizationSettings();

This will ask for the permission to disable battery optimization for the app.


Manufacturer specific Battery Optimization
bool isManBatteryOptimizationDisabled = await DisableBatteryOptimization.isManufacturerBatteryOptimizationDisabled;

This will return true, for the devices which doesn't support manufacturer specific battery optimization configuration as well for the devices on which, user has clicked on positive action for the manufacturer specific battery optimization configuration dialog.

await DisableBatteryOptimization.showDisableManufacturerBatteryOptimizationSettings("Your device has additional battery optimization", "Follow the steps and disable the optimizations to allow smooth functioning of this app");

This will show a dialog with steps to disable the manufacturer specific battery optimization on the current device (if it's available)

Note: We cannot determine if the user has actually disabled the manufacturer specific battery optimization or not. We can only show a dialog with the steps to disable it.


There are other helper methods available to check if all the permissions are enabled or disabled.

await DisableBatteryOptimization.isAllBatteryOptimizationDisabled
await DisableBatteryOptimization.showDisableAllOptimizationsSettings

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트