Open SuryaChinnadurai1997 opened 1 year ago
Any solution to this? same here and is not working on ios
@acamue No. Still i didn't get any solution
Mine iPhone XR, iOS 17.0.2 got this error:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(bgTaskSchedulingFailed(Error Domain=BGTaskSchedulerErrorDomain Code=1 "(null)") error, Scheduling the task using BGTaskScheduler has failed.
This may be due to too many tasks being scheduled but not run.
See the error for details: Error Domain=BGTaskSchedulerErrorDomain Code=1 "(null)"., null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)
<asynchronous suspension>
#2 Workmanager.registerOneOffTask (package:workmanager/src/workmanager.dart:192:7)
<asynchronous suspension>
Working well on Android
Did you test it on a real device and is Background App Refresh enabled in Settings?
Did you test it on a real device and is Background App Refresh enabled in Settings?
Yes. I tested in the iPhone real device and the Background App Refresh enabled in that device.
callbackDispatcher() is not executing in ios. Is any one have a solution?
I have one off tasks working on iOS
Pull in this branch in your pubspec.yaml
workmanager:
git:
url: https://github.com/absar/flutter_workmanager.git
ref: ios-bg-tasks-enh-final
And you must set debug to true when initializing in main.dart
Workmanager().initialize(callbackDispatcher, isInDebugMode: true);
@scottynoshotty Apply that package and it should work fine. Thanks.
@scottynoshotty Using the package you provided, callbackDispatcher is called normally, but no delay is applied. Even if you set the delay option, callbackDispatcher is called immediately. (Only on ios)
hi guys, what about Workmanager().registerPeriodicTask() ? on ios still do not work? i tryied the the solution @scottynoshotty but it works only on registerOneOffTask... i need to run a periodic work, anybody have a solution?
@AntonioVerdiglione1996 i need periodic too, can you resolve this issue?
Can someone help how to resolve it?
+1
Workmanager().registerPeriodicTask() not work on ios Any idea ?
Workmanager().registerPeriodicTask() not work on ios The same idea ?
I have checkout the example folder in the workmanager package and then ran the example in the iOS platform. But the callbackDispatcher is not execute when i resister registerOneOffTask. It's happens in the iphone real device
Code snippet:
https://github.com/fluttercommunity/flutter_workmanager/tree/main/example
Version
Describe the error Background task is not execute.
Output of
flutter doctor -v
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.1 22C65 darwin-arm64, locale en-US) • Flutter version 3.10.5 on channel stable at /Users/samv/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700 • Engine revision 45f6e00911 • Dart version 3.0.5 • DevTools version 2.23.1[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/samv/Library/Android/sdk • Platform android-33, build-tools 32.1.0-rc1 • ANDROID_HOME = /Users/samv/Library/Android/sdk • ANDROID_SDK_ROOT = /Users/samv/Library/Android/sdk • Java binary at: /Applications/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 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.12.1
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2) • 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.12+0-b1504.28-7817840)
[✓] VS Code (version 1.80.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.68.0
[✓] Connected device (3 available) • iPhone 14 Pro (mobile) • FAC97301-5BBE-422A-BECE-BD7361EB3013 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.1 22C65 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.198
[✓] Network resources • All expected network resources are available.
• No issues found!