You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter应用合规排查:向未成年人/未知年龄用户传输Advertising ID问题

Google Play家庭数据规范违规排查求助

我的Flutter应用已上线Google Play,收到通知违反《Google Play政策》中的「家庭数据规范」,原因是向未成年人或未知年龄用户传输Advertising ID。注:已错过整改截止日期,此情况与本次问询无关。

应用面向儿童及成年用户群体,为合规最大化收益,实现了中性年龄界面,在用户创建账号前验证是否年满13岁,以此决定是否展示个性化广告。

我编写了getNonPersonalizedAds方法用于判断是否展示非个性化广告,其中isUserChild(标识用户是否未满13岁)取自关联当前用户账号的Firestore文档。目前尚未实现该值的Firestore存储逻辑,因此方法的第一个子条件始终返回true,意味着当前无论用户年龄或其他参数,均不会展示个性化广告:

bool getNonPersonalizedAds(BuildContext context) {
  //if any of the following conditions are true, return true (to show NON-personalized ads)
  return Provider.of<UserStatsModel>(context, listen: false).isUserChild == null || //<-unknown age
      //! is for null safety, not negation:
      Provider.of<UserStatsModel>(context, listen: false).isUserChild! ||
      (Platform.isIOS && Provider.of<TrackingStatus>(context, listen: false) != TrackingStatus.authorized) ||
      //GDPR:
      Provider.of<ConsentStatus>(context, listen: false) != ConsentStatus.obtained;
}

所有创建/展示广告的代码位置都已调用该方法,示例如下:

_bannerAd = BannerAd(
      adUnitId: AdState.getAdUnitId(Ads.learningGuideBannerAd)!,
      size: AdSize.getInlineAdaptiveBannerAdSize(MediaQuery.of(context).size.width.toInt(), 75),
      request: AdRequest(nonPersonalizedAds: getNonPersonalizedAds(context)),
      listener: adState.adListener,
    );
    await _bannerAd!.load();

现在想请教:我的代码中还有哪些位置可能传输Android Advertising ID?或是所用依赖包导致了该违规问题?

应用使用的依赖包列表:

firebase_core: ^2.21.0
firebase_analytics: ^10.6.3
firebase_crashlytics: ^3.4.3
firebase_auth: ^4.12.1
google_sign_in: ^6.1.5
#  flutter_facebook_auth: ^4.4.1+1 #"if you are on macos with an intel processor you must use flutter_facebook_auth: 4.x" 
flutter_facebook_auth: ^5.0.10 #^^but using the newest version works for me
cloud_firestore: ^4.12.2
google_mobile_ads: ^2.4.0
firebase_app_check: ^0.2.1+3
#  intl: ^0.18.0

#in_app_purchase: ^3.1.5

#for firebase authentication (not by google)
provider: ^6.0.5

#other
app_tracking_transparency: ^2.0.4 #for iOS
flutter_spinkit: ^5.2.0
shared_preferences: ^2.2.2
flutter_tts: ^3.8.3
connectivity_plus: ^3.0.6 #to disable features when flutter_offline
scrollable_positioned_list: ^0.3.8
url_launcher: ^6.2.1 #hyperlinks
smooth_page_indicator: ^1.1.0 #used in the intro screen
another_flushbar: ^1.12.30 #used in mc words&sentences for example to show alternative translations
styled_text: ^7.0.0

#html_editor_enhanced: ^2.5.1
#flutter_quill: ^6.3.2
#quill_html_editor: ^2.0.5
webview_flutter: ^4.4.2 #the only one I got it to work with, see learning_guide_screen.dart

内容的提问来源于stack exchange,提问作者Cedric

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 05:43:13