public async void FirstRun(bool refresh = false) { RefreshStories(refresh); PostsGenerator.RunLoadMore(refresh); InboxViewModel.ResetInstance(); if (InboxViewModel.Instance != null) { try { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { if (InboxViewModel.Instance.SeqId <= 0) { await InboxViewModel.Instance.RunLoadMoreAsync(refresh); } if (MainPage.Current.RealtimeClient == null) { MainPage.Current.RealtimeClient = new InstagramApiSharp.API.RealTime.RealtimeClient(InstaApi); } var client = MainPage.Current.RealtimeClient; await client.Start(InboxViewModel.Instance.SeqId, InboxViewModel.Instance.SnapshotAt); client.DirectItemChanged += InboxViewModel.Instance.RealtimeClientDirectItemChanged; client.TypingChanged += InboxViewModel.Instance.RealtimeClientClientTypingChanged; client.BroadcastChanged += RealtimeClientBroadcastChanged; }); } catch { } } //MainView.Current?.MainViewInboxUc?.InboxVM?.RunLoadMore(refresh); if (InboxViewModel.Instance?.SeqId <= 0) { ActivitiesViewModel.Instance?.RunLoadMore(refresh); } }
public async void FirstRun(bool refresh = false) { //var u = await InstaApi.UserProcessor.GetUserAsync("rmt4006"); //var s = await InstaApi.StoryProcessor.GetUserStoryAndLivesAsync(u.Value.Pk); //var t = ""; //var live = await InstaApi.LiveProcessor.GetInfoAsync(t); //var user = await InstaApi.UserProcessor.GetUserInfoByIdAsync(15154078079); //var sss = await InstaApi.CreativeProcessor.GetAssetsAsync(); ////var inb = await Helper.InstaApi.MessagingProcessor.GetDirectInboxAsync(PaginationParameters.MaxPagesToLoad(1)); //var user = await InstaApi.UserProcessor.GetUserAsync("instagram"); //var sss = await InstaApi.MessagingProcessor.GetThreadByParticipantsAsync(0, user.Value.Pk); //var aabc = await InstaApi.AccountProcessor.GetNotificationsSettingsAsync("notifications"); ////var aabc = await InstaApi.AccountProcessor.GetNotificationsSettingsAsync("email_and_sms"); //return; /*await*/ var aaabx = await InstaApi.UserProcessor.GetFullUserInfoAsync(30808156545); var aaabxxxxxx = await InstaApi.UserProcessor.GetFullUserInfoAsync(InstaApi.GetLoggedUser().LoggedInUser.Pk); RefreshStories(refresh); //await Task.Delay(3500); //await PostsGenerator.RunLoadMoreAsync(refresh); PostsGenerator.RunLoadMore(refresh); InboxViewModel.ResetInstance(); if (InboxViewModel.Instance != null) { try { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { if (InboxViewModel.Instance.SeqId <= 0) { await InboxViewModel.Instance.RunLoadMoreAsync(refresh); } if (MainPage.Current.RealtimeClient == null) { MainPage.Current.RealtimeClient = new InstagramApiSharp.API.RealTime.RealtimeClient(InstaApi); } var client = MainPage.Current.RealtimeClient; await client.Start(InboxViewModel.Instance.SeqId, InboxViewModel.Instance.SnapshotAt); client.DirectItemChanged += InboxViewModel.Instance.RealtimeClientDirectItemChanged; client.TypingChanged += InboxViewModel.Instance.RealtimeClientClientTypingChanged; }); } catch { } } MainView.Current?.MainViewInboxUc?.InboxVM?.RunLoadMore(refresh); ActivitiesViewModel.Instance?.RunLoadMore(refresh); }