diff --git a/lib/src/app.dart b/lib/src/app.dart
index 3839e62e2fc435fa9676ad67840319490b334ff0..d9ea905180a204cffb1468c50d31d1ef66ac2420 100644
--- a/lib/src/app.dart
+++ b/lib/src/app.dart
@@ -114,11 +114,17 @@ class _MainAppState extends State<MainApp> {
       log("Err $error");
 
       String errorMessage = error.message;
-      String errorDetails  = error.details;
+      String errorDetails  = "";
+
+      try {
+        errorDetails = json.decode(error.details)["errorDescription"];
+      } catch (e) {
+        errorDetails = error.details;
+      }
 
       if (
         // Handle cancellation for Android
-        errorDetails == '{"type":0,"code":1,"errorDescription":"User cancelled flow"}' ||
+        errorDetails == 'User cancelled flow' ||
         // Handle cancellation for iOS
         errorMessage.toLowerCase().contains("the operation couldn")
       ) {