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

パッケージ詳細v1.7.0

background_fetch

iOS および Android でのバックグラウンドでの定期的なコールバック。Android ヘッドレス実装を含む。

AndroidiOS
30日間ダウンロード
12.3万
いいね数
1260
Pub ポイント
155

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

flutter pub add background_fetch

パッケージ概要

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

AndroidおよびiOSの両方で定期的なバックグラウンド実行を可能にするFlutterプラグインであり、アプリが閉じられている間でもデータ同期や更新の取得などのタスクを実行できます。AndroidのヘッドレスJSモードをサポートし、信頼性の高いバックグラウンド処理を実現し、プラットフォーム間で一貫したコールバックを提供します。プラットフォーム固有の回避策に頼らず、信頼性の高いバックグラウンド動作が必要な開発者向けに設計されています。

用途

  • バックグラウンドデータ同期
  • 定期的なタスク実行
  • プッシュ通知の処理
  • アプリ状態の維持
  • 位置トラッキング
  • オフラインデータの更新

主な機能

  • クロスプラットフォーム対応(Android および iOS)
  • Android ヘッドレス実装
  • カスタマイズ可能なバックグラウンド間隔
  • 永続的なバックグラウンド実行
  • イベント駆動型コールバックシステム
  • 低電力と電力最適化

適している対象

  • 定期的なバックグラウンド更新を必要とするアプリ
  • データ集約型アプリケーション
  • オフライン優先のモバイルアプリ
  • トラッキングまたはモニタリングサービス
  • バックグラウンドタスクの自動化

注意事項

  • Android でバックグラウンド権限が必要です
  • バッテリーの駆動時間に影響を与える可能性があります
  • iOS のバックグラウンド実行はシステムポリシーによって制限されています
  • ヘッドレスモード用の適切な設定が必要です
  • バックグラウンドフェッチはOSによって制限される可能性があります
  • 信頼性を確保するためには、実機でのテストが必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Background Fetch for Flutter

background_fetch · pub package

By Transistor Software, creators of Flutter Background Geolocation


Background Fetch is a very simple plugin which attempts to awaken an app in the background about every 15 minutes, providing a short period of background running-time. This plugin will execute your provided callbackFn whenever a background-fetch event occurs.

There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will never receive an event faster than 15 minutes. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently or if an iOS user disables background refresh they may not happen at all.

:new: Background Fetch now provides a scheduleTask method for scheduling arbitrary "one-shot" or periodic tasks.

iOS
  • There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will never receive an event faster than 15 minutes. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently.
  • scheduleTask seems only to fire when the device is plugged into power.
  • :warning: When your app is terminated, iOS no longer fires events — There is no such thing as stopOnTerminate: false for iOS.
  • iOS can take days before Apple's machine-learning algorithm settles in and begins regularly firing events. Do not sit staring at your logs waiting for an event to fire. If your simulated events work, that's all you need to know that everything is correctly configured.
  • If the user doesn't open your iOS app for long periods of time, iOS will stop firing events.
Android
  • The Android plugin provides a Headless implementation allowing you to continue handling events even after app-termination.

Contents

Licence

The MIT License

Copyright (c) 2018 Chris Scott, Transistor Software <chris@transistorsoft.com> https://www.transistorsoft.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

カテゴリー

ソースリポジトリ

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