I am following the notification listener docs, and one of the steps to register a background notification listener is to first check whether an existing one is already registered, by calling BackgroundTaskRegistration::AllTasks() to get all existing tasks, then enumerating over the map to see if one can be found. However, it seems like the method is not responding at all, as it is not returning anything and the code that follows isn't executed.
std::cout << "before" << std::endl;
auto all_tasks = BackgroundTaskRegistration::AllTasks();
std::cout << "after" << std::endl;
"before" is printed to the console but "after" is not.
For context, I am calling the method in a win32 context (Flutter desktop). Previous WinRT API calls like UserNotificationListener::Current() work just fine.
Any help is appreciated!
Envrionment:
- Windows 11 22000.65
- Visual Studio 2019
- Flutter 2.2 with windows desktop support enabled
- CMake 3.15 project (generated by Flutter)