SensorbergSDK.BackgroundTaskManager.UpdateBackgroundTaskAsync C# (CSharp) Метод

UpdateBackgroundTaskAsync() публичный Метод

Renew the registrations of the background taks.
public UpdateBackgroundTaskAsync ( SdkConfiguration configuration ) : Task
configuration SdkConfiguration Configuration for the new registration.
Результат Task
        public async Task<BackgroundTaskRegistrationResult> UpdateBackgroundTaskAsync(SdkConfiguration configuration)
        {
            UnregisterBackgroundTask();
            return await RegisterBackgroundTaskAsync(configuration);
        }

Usage Example

Пример #1
0
        public async Task <BackgroundTaskRegistrationResult> UpdateBackgroundTaskIfNeededAsync()
        {
            BackgroundTaskRegistrationResult result = new BackgroundTaskRegistrationResult()
            {
                Success   = true,
                Exception = null
            };

            if (BackgroundTaskManager.CheckIfBackgroundFilterUpdateIsRequired())
            {
                result = await _backgroundTaskManager.UpdateBackgroundTaskAsync(Configuration);
            }

            SdkData.BackgroundTaskEnabled = true;
            return(result);
        }