Skip to content

[Doc] IOS callback not called #396

@ghost

Description

  • I have read the README
  • I have done the setup for Android
  • I have done the setup for iOS
  • I have ran the sample app and it does not work there

Version
flutter 2.10.3

Technology Version
Workmanager version 0.5.0-dev.8
Xcode version 13.3.1
Swift version
iOS deployment target 11

Describe the error
Describe error
Optionally provide the least amount of code that shows this behaviour. Ideally in the sample app.

void callbackDispatcher() {
  debugPrint("test");
  Workmanager().executeTask((
    String task,
    Map<String, dynamic>? json,
  ) async {
    debugPrint("test 2");
    return true;
  }
}  
await Workmanager().initialize(
      callbackDispatcher,
      isInDebugMode: kDebugMode,
    );
Workmanager().registerOneOffTask(
"workmanager.background.task",
"workmanager.background.task",
tag: "workmanager.background.task",
)

The callback is never called on iOS, despite the fact that it works on Android...
I've done all the iOS setup part with 'workmanager.background.task' as task identifier because i use WorkManager 0.5.0-dev.8

Output of flutter doctor -v

[✓] Flutter (Channel stable, 2.10.3, on macOS 12.3.1 21E258 darwin-arm, locale fr-FR)
    • Flutter version 2.10.3 at /Users/*********/fvm/versions/2.10.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (3 months ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/*********/Library/Android/Sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_HOME = /Users/**********/Library/Android/Sdk
    • Java binary at: /Users/********/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8609683/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Connected device (2 available)
    • iPhone de ******** (mobile) • 037a70ff3ad9e7787722c6c239f94d2aadceb764 • ios            • iOS 15.4.1 19E258
    • Chrome (web)                  • chrome                                   • web-javascript • Google Chrome 102.0.5005.61

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions