Kaynağa Gözat

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

zk 7 ay önce
ebeveyn
işleme
19d51c8b9c
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  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");
+      }
     }
   }
 }