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

패키지 상세v1.7.0

background_fetch

iOS 및 Android에서 백그라운드의 주기적 콜백을 지원합니다. Android 헤드리스 구현이 포함되어 있습니다.

AndroidiOS
30일 다운로드
12.3만
좋아요
1.3천
Pub 점수
155

패키지 설치

flutter pub add background_fetch

패키지 개요

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

Android 및 iOS에서 주기적인 백그라운드 실행을 가능하게 하는 플러터 플러그인으로, 앱이 닫혀 있을 때도 데이터 동기화 또는 업데이트 가져오기와 같은 작업을 수행할 수 있게 해줍니다. Android의 헤드리스 JS 모드를 지원하여 신뢰할 수 있는 백그라운드 처리를 제공하며, 플랫폼 간 일관된 콜백을 제공합니다. 플랫폼별 특수한 대응책에 의존하지 않고 신뢰성 높은 백그라운드 활동이 필요한 개발자를 위한 것입니다.

사용 사례

  • 백그라운드 데이터 동기화
  • 주기적인 작업 실행
  • 푸시 알림 처리
  • 앱 상태 유지
  • 위치 추적
  • 오프라인 데이터 업데이트

주요 기능

  • 크로스 플랫폼 지원 (Android 및 iOS)
  • Android 헤드리스 구현
  • 사용자 정의 가능한 백그라운드 간격
  • 지속적인 백그라운드 실행
  • 이벤트 기반 콜백 시스템
  • 낮은 배터리 및 전력 최적화

적합한 대상

  • 정기적인 백그라운드 업데이트가 필요한 앱
  • 데이터 집약형 애플리케이션
  • 오프라인 우선 모바일 앱
  • 트래킹 또는 모니터링 서비스
  • 백그라운드 작업 자동화

고려 사항

  • Android에서 백그라운드 권한이 필요합니다
  • 배터리 수명에 영향을 줄 수 있습니다
  • iOS 백그라운드 실행은 시스템 정책에 의해 제한됩니다
  • 헤드리스 모드를 위해 적절한 구성이 필요합니다
  • 백그라운드 가져오기는 운영체제에 의해 제한될 수 있습니다
  • 신뢰성 확보를 위해 실제 기기에서 테스트가 필요합니다

원본 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.

카테고리

소스 저장소

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