feat(mobile): iOS background sync (#1758)

* first run of getting background sync working in iOS

* got background sync calling into flutter

* added background task

* added necessary sync files

* fixed some names and added more implementations

* got as far as Hive.initFlutter

* brute force got to await Hive.initFlutter

* lots of print statements to figure out where execution is failing, and its failing at the root asset bundle in the localization.dart service

* first time working, got plugins registered

* removed broken cleanup code

* refactored

* linters

* now can pass user settings

* background service plugin uses app background processing instead of fetch

* renamed backgroundFetch to backgroundProcessing to make it clearer

* don't use max delay

* adds fetch back in

* fixes require charging default values and backup controller page

* fixes background fetch

* fixes ios not importing photos

* guarded path provider ios

* lint

* adds max tries for heartbeat to work in iOS

* fail after seconds

* timeout instead of fail after seconds

* removes release lock from system stop

* restores checkLockReleasedWithHeartbeat to Future<void>

* removes max tries from acquire lock

* fixes lock timeout with iOS

* restored for loop

* adds comments, made the AppRefresh task only run while not requiring network or charge

* fixed compile issue

* now both are registered and added better comments. also added ability for task to cancel itself

* added the podfile and pubspec

* added backup diagnostics to IOS and removed iOS ignored backup options and fixed network connectivity always required

* Added Alex's dev team

* styled debug list item, fixed refresh task not set bug, fixed enable / disable background service on platform channel

---------

Co-authored-by: Marty Fuhry <marty@fuhry.farm>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
martyfuhry
2023-02-20 00:59:50 -05:00
committed by GitHub
parent 2cf42e867c
commit 87fea29e32
16 changed files with 926 additions and 284 deletions

View File

@@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: cancellation_token
sha256: "44891ef71d605bc59ef7974c403630d8e8506fcd897a29c3e38466ef69e5c4eb"
sha256: e40ac742c7faac52e1719ce249934e20975e5772d40112e1e01cfc5abf24185a
url: "https://pub.dev"
source: hosted
version: "1.6.1"
version: "1.5.0"
cancellation_token_http:
dependency: "direct main"
description:
@@ -333,10 +333,10 @@ packages:
dependency: transitive
description:
name: fixnum
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.0.1"
flutter:
dependency: "direct main"
description: flutter
@@ -428,10 +428,10 @@ packages:
dependency: transitive
description:
name: flutter_riverpod
sha256: "0c997763ce06359ee4686553b74def84062e9d6929ac63f61fa02465c1f8e32c"
sha256: "46a27b7a11dc13738054093076f2dc65692ddcd463979b15092accf5681aea20"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -483,10 +483,10 @@ packages:
dependency: transitive
description:
name: glob
sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c"
sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.0"
graphs:
dependency: transitive
description:
@@ -523,10 +523,10 @@ packages:
dependency: "direct main"
description:
name: hooks_riverpod
sha256: "71695b2e1dfc22a39f1f9c67b798f8f8f1521f2d0349817d13ccdd5c4cd7acba"
sha256: a596bcb1eaf48eae6da1ce8b9e60ec9538ef7d15725e941c3626f29dfcc01d96
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.2.0"
html:
dependency: transitive
description:
@@ -851,6 +851,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_ios:
dependency: "direct main"
description:
name: path_provider_ios
sha256: "03d639406f5343478352433f00d3c4394d52dac8df3d847869c5e2333e0bbce8"
url: "https://pub.dev"
source: hosted
version: "2.0.11"
path_provider_linux:
dependency: transitive
description:
@@ -975,10 +983,10 @@ packages:
dependency: transitive
description:
name: riverpod
sha256: "0f43c64f1f79c2112c843305a879a746587fb7c1e388f1d4717737796756e2c4"
sha256: "59a48de9c757aa61aa28e9fd625ffb360d43b6b54606f12536622c55be9e8c4b"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.2.0"
rxdart:
dependency: transitive
description:
@@ -1492,10 +1500,10 @@ packages:
dependency: transitive
description:
name: xml
sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5"
sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb
url: "https://pub.dev"
source: hosted
version: "6.2.2"
version: "6.1.0"
xxh3:
dependency: transitive
description:
@@ -1513,5 +1521,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.19.0 <4.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"