public Task <bool> OnBackButtonPressedAsync() { // Always close the app on Back button press on this screen // (in Debug mode the user may have been routed to here from the passcode screen, but Back button should not navigate back to there) _closeApplication.CloseApp(); return(Task.FromResult(false)); }
/// <summary> /// Do check if permissions granted and request if not. Abort if User denies /// </summary> private void DoPermissionsCheck() { // This will abort the app at the start if the WIFI permissions are not given Xamarin.Forms.Device.BeginInvokeOnMainThread(async() => { if (!await this.CheckPermissions()) { ICloseApplication closeApp = DependencyService.Get <ICloseApplication>(); await Application.Current.MainPage.DisplayAlert( App.GetText(MsgCode.Error), "Insufficient permissions", App.GetText(MsgCode.Ok)); closeApp.CloseApp(); } }); }
public async Task <bool> OnBackButtonPressedAsync() { var closeApp = true; #if DEBUG closeApp = !await Mvx.Resolve <ICustomUserInteraction>().ConfirmAsync("DEBUGGING: Return to Customer Code screen?", cancelButton: "No, close the app"); #endif if (closeApp) { _closeApplication.CloseApp(); } else { ShowViewModel <CustomerCodeViewModel>(); } return(false); }
private async Task LogAndCloseAsync(Exception ex) { await this.LogEventAsync(ex); _closeApplication.CloseApp(); }