【问题标题】:How to get real time update in a Flutter app when the app is in background?当应用程序处于后台时,如何在 Flutter 应用程序中获取实时更新?
【发布时间】:2021-05-11 07:05:01
【问题描述】:

在我的 Flutter 应用中,我需要每 10 秒更新一次移动用户的位置,即使该应用未处于活动状态(已终止)。

我如何做到这一点?

我经历过background_fetchworkmanager

两者都有错误并且不能满足我的需求,因为它们遵循操作系统的标准,即至少每 15 分钟定期执行一次。

【问题讨论】:

    标签: flutter dart dart-isolates


    【解决方案1】:

    现在在颤振中做到这一点并不容易。我所做的是在 android 中编写代码并使用 methodChannel 传达 con dart 代码,这是我关注的帖子: How to create a service in Flutter to make an app to run always in background?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-25
      • 1970-01-01
      • 2017-11-06
      相关资源
      最近更新 更多