Explorar o código

[fix]优化当oaid无法获取导致异常的问题

zk hai 7 meses
pai
achega
19d51c8b9c
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      lib/device/platform_android_info.dart

+ 6 - 2
lib/device/platform_android_info.dart

@@ -17,8 +17,12 @@ class PlatformAndroidInfo {
           .setBrand(androidInfo.brand)
           .setModel(androidInfo.model);
 
-      String? oaid = await Oaid.getOaid();
-      atmobPlatformInfo.setOaid(oaid);
+      try {
+        String? oaid = await Oaid.getOaid();
+        atmobPlatformInfo.setOaid(oaid);
+      } catch (e) {
+        print("Failed to get OAID: $e");
+      }
     }
   }
 }