隐私控制

隐私控制

此章节将演示如何在初始化时配置用户的隐私信息控制

提示

如无特殊需求,可以直接跳转到【常见问题

个性化推荐与程序化推荐

说明

为遵循《个人信息保护法》相关法规,ZJSDK 将为开发者提供个性化广告关闭能力接口,开发者可以调用接口,为用户提供个性化广告关闭能力。开发者应遵循法律法规要求,在客户端为用户创建可便捷查找的个性化广告关闭按钮,并保证用户点击关闭按钮后调用 ZJSDK 关闭能力接口,保证个性化广告关闭功能真实有效。

个性化推荐

应用需要自行记录个性化推荐的开关状态,在状态发生变化时调用ZJAndroid.setPersonalizedState(bool)方法配置,下次启动后生效。调用时请确保 SDK 已初始化完成

方法参数
ZJAndroid#setPersonalizedState(bool state)state: 是否开启推荐

程序化推荐

应用需要自行记录程序化推荐的开关状态,在状态发生变化时调用ZJAndroid.setProgrammaticRecommend(bool)方法配置,下次启动后生效。调用时请确保 SDK 已初始化完成

方法参数
ZJAndroid#setProgrammaticRecommend(bool state)state: 是否开启推荐

隐私信息控制

说明

ZJSDK 已支持工信部隐私敏感权限要求。SDK 不会强制获取任何敏感权限,以下系统权限及用户授权均为可选配置,不获取不影响 SDK 功能。

配置方法

开发者需要在调用 initWithoutStart() 初始化时传入customController属性来配置隐私权限开关

/// 隐私权限控制
class ZJCustomController {
  static const List<String> defaultInstalledPackages = [];

  /// 主动获取定位
  final bool canReadLocation;

  /// 经度
  final double longitude;

  /// 纬度
  final double latitude;

  /// 主动获取设备信息
  final bool canUsePhoneState;

  /// IMEI
  final String imei;

  /// 主动获取AndroidID
  final bool canUseAndroidId;

  /// AndroidID
  final String androidId;

  /// 主动获取MAC地址
  final bool canUseMacAddress;

  /// MAC地址
  final String macAddress;

  /// 主动获取OAID
  final bool canUseOaid;

  /// OAID
  final String oaid;

  /// 主动获取GAID
  final bool canUseGaid;

  /// GAID
  final String gaid;

  /// 获取网络状态
  final bool canUseNetworkState;

  /// 使用存储
  final bool canUseStoragePermission;

  /// 主动读取已安装应用列表
  final bool canReadInstalledPackages;

  /// 已安装应用列表
  final List<String> installedPackages;
  
  /// 是否允许SDK在申明和授权了的情况下使用录音权限
  bool canRecordAudio;

  /// 是否允许SDK主动获取BootID
  bool canReadBootId;

  /// 是否允许获取附近的Wifi列表
  bool canReadNearbyWifiList;

  /// 是否允许获取传感器信息
  bool canUseSensor;

  /// 是否允许 SDK 主动获取运营商信息
  bool canUseSimOperator;

  /// 当 canUseSimOperator==false 时,可传入运营商编码,例如:46000
  final String simOperatorCode;

  /// 当 canUseSimOperator==false 时,可传入运营商名称,例如:中国移动
  final String simOperatorName;

  /// 是否允许SDK使用定位权限,默认为YES, 仅iOS生效
  bool? canUseLocation;

  /// 是否允许SDK使用WiFi BSSID,默认为YES, 仅iOS生效
  bool? canUseWiFiBSSID;

  /// 是否允许SDK获取IDFA,默认为YES, 仅iOS生效
  bool? canUseIDFA;

  /// 是否允许SDK获取IDFV,默认为YES, 仅iOS生效
  bool? canUseIDFV;

  /// 是否允许获取手机状态信息,默认为YES, 仅iOS生效
  bool? canUsePhoneStatus;

  /// 收否允许获取手机DeviceId,默认为YES, 仅iOS生效
  bool? canUseDeviceId;

  /// 是否允许获取手机系统版本名,默认为YES, 仅iOS生效
  bool? canUseOSVersionName;

  /// 是否允许获取手机系统版本号,默认为YES, 仅iOS生效
  bool? canUseOSVersionCode;

  /// 是否允许获取手机应用包名,默认为YES, 仅iOS生效
  bool? canUsePackageName;

  /// 是否允许获取手机应用版本名,默认为YES, 仅iOS生效
  bool? canUseAppVersionName;

  /// 是否允许获取手机应用版本号,默认为YES, 仅iOS生效
  bool? canUseAppVersionCode;

  /// 是否允许获取手机设备品牌,默认为YES, 仅iOS生效
  bool? canUseBrand;

  /// 是否允许获取手机设备型号,默认为YES, 仅iOS生效
  bool? canUseModel;

  /// 是否允许获取手机屏幕分辨率,默认为YES, 仅iOS生效
  bool? canUseScreen;

  /// 是否允许获取手机屏幕方向,默认为YES, 仅iOS生效
  bool? canUseOrient;

  /// 是否允许获取手机网络类型,默认为YES, 仅iOS生效
  bool? canUseNetworkType;

  /// 是否允许获取手机移动网络代码,默认为YES, 仅iOS生效
  bool? canUseMNC;

  /// 是否允许获取手机移动国家代码,默认为YES, 仅iOS生效
  bool? canUseMCC;

  /// 是否允许获取手机系统语言,默认为YES, 仅iOS生效
  bool? canUseOSLanguage;

  /// 是否允许获取手机时区,默认为YES, 仅iOS生效
  bool? canUseTimeZone;

  /// 是否允许获取手机User Agent,默认为YES, 仅iOS生效
  bool? canUseUserAgent;

  /// 是否允许SDK主动使用互动组件能力(摇一摇、扭一扭等),默认为YES, 仅iOS生效
  bool? isCanUseMotionManager;

  /// 是否允许获取IP地址
  bool? canUseIPAddress;
  
  ZJCustomController({this.canReadLocation = true,
    this.longitude = 0.0000,
    this.latitude = 0.0000,
    this.canUsePhoneState = true,
    this.imei = "",
    this.canUseAndroidId = true,
    this.androidId = "",
    this.canUseMacAddress = true,
    this.macAddress = "",
    this.canUseOaid = true,
    this.oaid = "",
    this.canUseGaid = true,
    this.gaid = "",
    this.canUseNetworkState = true,
    this.canUseStoragePermission = true,
    this.canReadInstalledPackages = true,
    this.installedPackages = defaultInstalledPackages,
    this.canRecordAudio = true,
    this.canReadBootId = true,
    this.canReadNearbyWifiList = true,
    this.canUseSensor = true,
    this.canUseSimOperator = true,
    this.simOperatorCode = "",
    this.simOperatorName = "",
    this.canUseLocation = true,
    this.canUseWiFiBSSID = true,
    this.canUseIDFA = true,
    this.canUseIDFV = true,
    this.canUsePhoneStatus = true,
    this.canUseDeviceId = true,
    this.canUseOSVersionName = true,
    this.canUseOSVersionCode = true,
    this.canUsePackageName = true,
    this.canUseAppVersionName = true,
    this.canUseAppVersionCode = true,
    this.canUseBrand = true,
    this.canUseModel = true,
    this.canUseScreen = true,
    this.canUseOrient = true,
    this.canUseNetworkType = true,
    this.canUseMNC = true,
    this.canUseMCC = true,
    this.canUseOSLanguage = true,
    this.canUseTimeZone = true,
    this.canUseUserAgent = true,
    this.isCanUseMotionManager = true,
    this.canUseIPAddress = true,
    });
}

注意

当开发者的隐私限制状态发生变动时,为使部分仅静态配置的 ADN 隐私限制生效,建议调用ZJAndroid.onCustomControllerUpdate(ZJCustomController? customController)方法主动通知 SDK 以同步生效