flutter_workmanager
                                
                                
                                
                                    flutter_workmanager copied to clipboard
                            
                            
                            
                        Passing parameter in inputData won't work in ios
- [x] I have read the README
 - [x] I have done the setup for iOS
 - [x] I have ran the sample app and it does not work there
 
Version
| Technology - Ios | Version - 2.17.1 | 
|---|---|
| Workmanager version | 0.5.0 | 
| Xcode version | 13.2.1 | 
| iOS deployment target | 11.0 | 
Describe the error Describe error using the below method for register the one off task and passing the inputData into it. While getting the data in callDispatcher handler returns null in ios code snippet: Workmanager().registerOneOffTask( 'test', 'test', inputData: { 'taskName': 'test', }, existingWorkPolicy: ExistingWorkPolicy.replace, constraints: Constraints( networkType: NetworkType.connected, ), );
handling callback:
Workmanager().executeTask((task, inputData) async { switch (task) { case Workmanager.iOSBackgroundTask: String taskName = inputData?['taskName']; // breaks over here print('>> task name '+ taskName);// always prints as null break; } return Future.value(true); });
// the print function always return null in ios but working fine in Android
hi @ened any update on this issue as clearly mentioned in documentation that inputData is supported in iOS but always getting null. Please update this issue.
(Major issue)
What about this issue : https://github.com/fluttercommunity/flutter_workmanager/issues/298 If inputData should be passed, the issue as mentioned should be closed.
Pull request to fix this issue here : https://github.com/fluttercommunity/flutter_workmanager/pull/398