소스 검색

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

zk 7 달 전
부모
커밋
19d51c8b9c
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  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");
+      }
     }
   }
 }