private async Task ConnectionChanged() { try { await OAuthHelper.SyncOfflineItems(); } catch (Exception ex) { //ShowError(ex.Message); } //var userCredentials = App.DAUtil.GetMasterInfoByName("UserCredentials"); //if (userCredentials != null) //{ // var cred = JsonConvert.DeserializeObject<dynamic>(userCredentials.content); // string uName = cred.Username; // string pwd = cred.Password; // await OAuthHelper.GetAuthenticationHeader(uName, pwd).ContinueWith(async (x) => // { // try // { // await OAuthHelper.SyncOfflineItems(); // } // catch (Exception ex) // { // ShowError(ex.Message); // } // }).ConfigureAwait(false); //} }
public async static Task SyncOfflineItemsBG() { try { var updatedCount = await OAuthHelper.SyncOfflineItems(); if (updatedCount > 0) { CrossLocalNotifications.Current.Show("", "Offline items has been synced"); } } catch (Exception ex) { } }
public async Task SyncLocalData() { try { await OAuthHelper.SyncOfflineItems(); var users = await SPUtility.GetUsersForPicker(); if (users != null) { App.peoplePickerDataSource = new List <PeoplePicker>(users); } } catch (Exception ex) { ShowError(string.Format("Unable to sync local info: {0}", ex.Message)); } }