From 713a50238b82e63fb9a547b6c640d0ec387d444c Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 26 Apr 2023 16:12:20 +0200 Subject: [PATCH 1/2] Also attempt to cancel customRegistration during during our cancel --- example/lib/screens/login_screen.dart | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/example/lib/screens/login_screen.dart b/example/lib/screens/login_screen.dart index 2f9fd2ad..242df9e8 100644 --- a/example/lib/screens/login_screen.dart +++ b/example/lib/screens/login_screen.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:onegini/callbacks/onegini_custom_registration_callback.dart'; import 'package:onegini/callbacks/onegini_registration_callback.dart'; import 'package:onegini/events/onewelcome_events.dart'; import 'package:onegini/model/request_details.dart'; @@ -110,14 +111,14 @@ class _LoginScreenState extends State { cancelRegistration() async { setState(() => isLoading = false); - - await OneginiRegistrationCallback() - .cancelBrowserRegistration() - .catchError((error) { - if (error is PlatformException) { - showFlutterToast(error.message); - } - }); + try { + await Future.any([ + OneginiRegistrationCallback().cancelBrowserRegistration(), + OneginiCustomRegistrationCallback().submitErrorAction('Canceled') + ]); + } on PlatformException catch (error) { + showFlutterToast(error.message); + } } Future> getUserProfiles() async { From f11788561652e8ddfb90abb66a7401937e2de55e Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 26 Apr 2023 16:20:18 +0200 Subject: [PATCH 2/2] Update the errorcode for which we check during getBiometricAuthenticator --- example/lib/screens/user_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/screens/user_screen.dart b/example/lib/screens/user_screen.dart index c5ce6dfd..a38aa3c6 100644 --- a/example/lib/screens/user_screen.dart +++ b/example/lib/screens/user_screen.dart @@ -84,7 +84,7 @@ class _UserScreenState extends State with RouteAware { _biometricAuthenticator = biometricAuthenticator; }); } on PlatformException catch (err) { - if (err.code != "8043") { + if (err.code != "8060") { showFlutterToast(err.message); } }