Skip to content

iOS sync stop when app is in background and screen off only in Release #5041

@JeremyLabelIO

Description

@JeremyLabelIO

Description

Hi,

After updating amplify_flutter and amplify_datastore from 1.8.0 to 2.1.0 if I put my iOS app in background, turn off the screen, the sync is completely stopped. The only way to start sync again is to kill the app and relaunch it.

Everything works fine in debug but not in release.

I already try this :

As of next steps, please enable optimizations in your debug build and see if the issue is occurring when enabling the optimization. In addition, by using this way you will be able to obtain logs regarding the issue:
https://github.com/apple/swift/blob/main/docs/OptimizationTips.rst#enabling-optimizations

  • "In the Project Navigator, select the project icon to enter the Project Editor. In the project editor, select the icon under the "Project" header to enter the project settings editor. From there, an optimization setting can be applied to every target in the project by changing the "Optimization Level" field under the "Build Settings" header."

But I have still no logs and no changes.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)

Pubspec :

environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_launcher_icons:
intl: ^0.19.0
amplify_flutter: 2.1.0
amplify_datastore: 2.1.0
amplify_api: 2.1.0
amplify_auth_cognito: 2.1.0
amplify_storage_s3: 2.1.0

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

  1. Start the app on your iPhone and check sync work normally.
  2. Put the app in background
  3. Turn off the screen
  4. Do some changes in another device
  5. Reopen the app on your iPhone
  6. You do not receive any update from the cloud
  7. If you want to have update again, you have to kill the app and relaunch it.

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.22.2

Amplify Flutter Version

2.1.0

Deployment Method

Amplify CLI

Schema

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working; the issue has reproducible steps and has been reproduceddatastoreIssues related to the DataStore CategoryiOSIssues specific to the iOS Platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions