Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev1.7.0

background_fetch

Chamadas periódicas em segundo plano para iOS e Android. Inclui implementação headless do Android.

AndroidiOS
Downloads em 30 dias
123 mil
Curtidas
1,3 mil
Pontos Pub
155

Instalar pacote

flutter pub add background_fetch

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

Um plugin Flutter que permite execução periódica em segundo plano no Android e no iOS, permitindo que aplicativos realizem tarefas como sincronização de dados ou busca por atualizações mesmo quando o app está fechado. Ele suporta o modo Headless JS do Android para processamento confiável em segundo plano e fornece callbacks consistentes entre plataformas. Projetado para desenvolvedores que precisam de atividade em segundo plano confiável sem depender de soluções específicas da plataforma.

Casos de uso

  • Sincronização de dados em segundo plano
  • Execução periódica de tarefas
  • Tratamento de notificação por push
  • Manutenção de estado do aplicativo
  • Rastreamento de localização
  • Atualizações de dados offline

Principais recursos

  • Suporte multiplataforma (Android e iOS)
  • Implementação Android Headless
  • Intervalos de fundo configuráveis
  • Execução em segundo plano persistente
  • sistema de retorno de chamada baseado em eventos
  • Bateria baixa e otimização de energia

Indicado para

  • Aplicativos que exigem atualizações regulares em segundo plano
  • Aplicações intensivas em dados
  • Aplicativos móveis com foco em offline
  • Serviços de rastreamento ou monitoramento
  • Automação de tarefas em segundo plano

Considerações

  • Requer permissão em segundo plano no Android
  • Pode afetar a vida útil da bateria
  • A execução em segundo plano no iOS é limitada pelas políticas do sistema
  • Necessita de configuração adequada para o modo headless
  • A busca em segundo plano pode ser limitada pelo sistema operacional
  • Requer testes em dispositivos reais para confiabilidade

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

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.

Categorias

Repositório-fonte

Projetos que usam este pacote