getBaseDeviceId static method

Future<String?> getBaseDeviceId()

获取 AndroidId

Implementation

static Future<String?> getBaseDeviceId() async {
  try {
    String? deviceId = await deviceIdentifier.getBestDeviceIdentifier();
    // 根据 AndroidId 生成 UUID
    if (deviceId != null && deviceId.isNotEmpty) {
      return deviceId;
    }
    return null;
  } catch (e, stackTrace) {
    StormyLog.e(
      'AppUtils.getBaseDeviceId: 获取BaseDeviceId失败',
      stackTrace: stackTrace,
      extra: {'error': e.toString()},
    );
    return null;
  }
}