Browse Source

1、imei只有用户同意用户协议的情况下才获取

tags/0.0.15+9
PH2 3 years ago
parent
commit
9c5be24383
2 changed files with 8 additions and 1 deletions
  1. +3
    -0
      lib/util/global_config.dart
  2. +5
    -1
      lib/util/net_util.dart

+ 3
- 0
lib/util/global_config.dart View File

@@ -50,4 +50,7 @@ class GlobalConfig {
///guide缓存表记
static final String GUIDE='sp_guide';

/// 用户协议显示 用户是否同意隐私协议
static String isShowPolicy = "is_show_policy";

}

+ 5
- 1
lib/util/net_util.dart View File

@@ -446,7 +446,11 @@ class NetUtil {
/// 获取Android imei
static Future<String> getImei() async {
try {
return await FlutterAlibc.getUdid();
// 用户同意隐私协议之后才能读取
String isShowPolicy = await SharedPreferencesUtil.getStringValue(GlobalConfig.isShowPolicy);
if (!EmptyUtil.isEmpty(isShowPolicy) && '1' == isShowPolicy) {
return await FlutterAlibc.getUdid();
}
} catch (e, s) {
Logger.error(e, s);
}


Loading…
Cancel
Save