/// <summary> /// Clear settings values we do no longer use. /// </summary> public static void ClearObsoleteSettings() { // If is the first run of the app, remove a possible session of a previous installation if (SettingsService.Load(ResourceService.SettingsResources.GetString("SR_AppFirstRun"), true)) { SettingsService.RemoveSessionFromLocker(); SettingsService.Save(ResourceService.SettingsResources.GetString("SR_AppFirstRun"), false); } var lastAppVersion = SettingsService.Load <string>( ResourceService.SettingsResources.GetString("SR_LastAppVersion"), null); if (lastAppVersion == null) { return; } }
/// <summary> /// Method that executes the actions needed for a logout /// </summary> public static void LogoutActions() { // Disable the "Camera Uploads" service if is enabled if (TaskService.IsBackGroundTaskActive(CameraUploadService.TaskEntryPoint, CameraUploadService.TaskName)) { LogService.Log(MLogLevel.LOG_LEVEL_INFO, "Disabling CAMERA UPLOADS service (LOGOUT)"); TaskService.UnregisterBackgroundTask(CameraUploadService.TaskEntryPoint, CameraUploadService.TaskName); } // Clear settings, offline, cache, previews, thumbnails, etc. SettingsService.ClearSettings(); SettingsService.RemoveSessionFromLocker(); ClearOfflineAsync(); ClearAppCacheAsync(true); // Clear all the account and user data info AccountService.ClearAccountDetails(); AccountService.ClearUserData(); // Clear all the contacts info ContactsService.Clear(); }