BackgroundTaskDeferral.Complete works normally when the application runs with debugging, the main project can catch OnComplete event even when the app is suspended.
But when the app runs without debugging and the app goes to background, BackgroundTaskDeferral.Complete does not work. the main project can not receive anything when background task call (when main project catch event OnComplete I will show a toast notification)
BackgroundTaskDeferral _deferral = taskInstance.GetDeferral();
_deferral.Complete();