Hi,
Have you checked if addOnLicense->Value->IsActive value is true?
create_task(...).then(...) is an asynchronous operation and does not block the function return false
You can use get to wait for the result:
bool WindowsRuntimeComponent1::Class1::CheckIfUserHasSubscription(){
......
auto taskResult = create_task (
......
if (addOnLicense->Value->IsActive)
return true;
else
return false;
}, task_continuation_context::get_current_winrt_context ());
initWindow->Release();
return taskResult.get ();
}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.