优化storeAppInfo方法,首次打开不获取android_id

This commit is contained in:
yezian 2024-05-01 01:23:11 +08:00
parent 746caa61fb
commit 39e50ca2ce
1 changed files with 3 additions and 0 deletions

View File

@ -25,7 +25,9 @@ import { Platform } from "react-native";
export async function storeAppInfo() {
const Application = require("expo-application");
async function getDid() {
const notFirstTimeOpenApp = await get("not_first_time_open_app");
if (Platform.OS === "android") {
if (!notFirstTimeOpenApp) return "";
return Application.getAndroidId();
} else {
return await Application.getIosIdForVendorAsync();
@ -33,6 +35,7 @@ export async function storeAppInfo() {
}
const b_did = await getDid();
console.log(b_did);
const b_ver = Application.nativeApplicationVersion;
const b_dt = Device.osName === "Android" ? 0 : 1;
const b_ch = "production";