Version
| Technology |
Version |
| Workmanager version |
0.5.0-dev.8 |
| Xcode version |
13.2.1 |
| Swift version |
5.5.2-dev |
| iOS deployment target |
13.0 |
Describe the error
I am not able to schedule OneOff task on iOS. I can only do it if I through debug, "Simulate background fetch" which gets me
2022-02-01 01:09:06.770562-0700 Runner[15798:4641652] flutter: notifications set ios 2022-02-01 01:09:06.853857-0700 Runner[15798:4640548] [workmanager.BackgroundWorker] performBackgroundRequest(_:) -> performBackgroundRequest.newData (finished in 0.48 seconds)
I know everything is set up correctly because simulation would not work otherwise...
The same issue on Workmanager 0.4.1 except, here is the interesting part, 0.4.1 would give me this error when I would register my task
PlatformException(unhandledMethod("registerOneOffTask") error, Unhandled method registerOneOffTask, null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7) #1 MethodChannel._invokeMethod
This error no longer occurs on prerelease 0.5.0-dev.8, but still not scheduling the task. I also cannot schedule the task on the sample app provided.
I tested this on my physical iPhone 11 (iOS 15.2.1).
Output of flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-CA)
• Flutter version 2.8.1 at /users/saad/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/saad/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
Version
Describe the error
I am not able to schedule OneOff task on iOS. I can only do it if I through debug, "Simulate background fetch" which gets me
2022-02-01 01:09:06.770562-0700 Runner[15798:4641652] flutter: notifications set ios 2022-02-01 01:09:06.853857-0700 Runner[15798:4640548] [workmanager.BackgroundWorker] performBackgroundRequest(_:) -> performBackgroundRequest.newData (finished in 0.48 seconds)I know everything is set up correctly because simulation would not work otherwise...
The same issue on Workmanager 0.4.1 except, here is the interesting part, 0.4.1 would give me this error when I would register my task
PlatformException(unhandledMethod("registerOneOffTask") error, Unhandled method registerOneOffTask, null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7) #1 MethodChannel._invokeMethodThis error no longer occurs on prerelease 0.5.0-dev.8, but still not scheduling the task. I also cannot schedule the task on the sample app provided.
I tested this on my physical iPhone 11 (iOS 15.2.1).
Output of
flutter doctor -v[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-CA)
• Flutter version 2.8.1 at /users/saad/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/saad/Library/Android/sdk
✗ cmdline-tools component is missing
Run
path/to/sdkmanager --install "cmdline-tools;latest"See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run
flutter doctor --android-licensesto accept the SDK licenses.See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter