private async void OnNavigated(object sender, WebNavigatedEventArgs e) { if (e.Result == WebNavigationResult.Failure) { new CustomPopup( LocalizedStrings.AuthNoInternetError, LocalizedStrings.Retry, OnAppearing) .Show(); return; } var url = new Uri(((UrlWebViewSource)loginWebView.Source).Url); if (AuthorizationManager.AuthorizeFromUrl(url)) { await AuthorizationManager.SetPhoto(); Navigation.InsertPageBefore(new DialogsPage(dialogsManager, messagesManager), Navigation.NavigationStack[0]); await Navigation.PopToRootAsync(); _ = longPollingManager.Start().ConfigureAwait(false); refreshingPopup?.Dismiss(); refreshingPopup = null; return; } var script = AuthorizationPageScript.Script .Replace("{PleaseWait}", LocalizedStrings.PleaseWait); loginWebView.Eval(script); refreshingPopup?.Dismiss(); refreshingPopup = null; }
protected override void OnResume() { _ = longPollingManager.Start().ConfigureAwait(false); base.OnResume(); }