パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.1.2

disable_battery_optimization

バッテリー最適化のチェックおよび無効化用のFlutterプラグイン。また、Mi、Xiaomi、Samsung、Oppo、Huawei、OnePlusなどのデバイスで最適化を無効にするためのカスタム手順も表示します

Android
30日間ダウンロード
1.4万
いいね数
129
Pub ポイント
150

パッケージをインストール

flutter pub add disable_battery_optimization

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Androidデバイスのバッテリー最適化をチェックおよび無効にするFlutterプラグインで、バックグラウンド実行を必要とするアプリに特に役立ちます。小米、サムスン、オポ、ファーウェイ、ワンプラスなどの人気ブランド向けにカスタマイズされた手順を提供し、ユーザーが手動で設定することでアプリの動作を途切れなく保つようガイドします。このプラグインは、OSがアプリの活動を制限することを防ぐことで、位置追跡、プッシュ通知、バックグラウンド同期などのサービスの信頼性を高めます。

用途

  • バックグラウンドタスクの実行
  • バックグラウンドでの位置追跡
  • プッシュ通知の信頼性
  • 長期間のデータ同期
  • アプリパフォーマンス最適化
  • バッテリー寿命管理

主な機能

  • デバイス固有の最適化ガイド
  • 自動バッテリー最適化のチェック
  • 主要なAndroidブランドのサポート
  • Flutter との簡単な統合
  • ユーザーの指示をクリアする
  • クロスデバイス互換性

適している対象

  • 永続的なバックグラウンドプロセスを必要とするアプリ
  • Android OEMをターゲットとする開発者
  • 信頼性のあるフォアグラウンド実行を必要とするサービス
  • リアルタイム更新付きのモバイルアプリ
  • エンタープライズまたはユーティリティアプリケーション

注意事項

  • Android プラットフォームのみが必要
  • 一部のステップではユーザー操作が必要です
  • リストアップされた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

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト