### Handling Interaction Callbacks Source: https://pub.dev/packages/flutter_tencentad/changelog Example of handling interaction callbacks for interstitial ads, specifically capturing the reward transaction ID. ```dart FlutterTencentadInteractionCallBack( onVerify: (transId,rewardName,rewardAmount){ print("广告奖励凭证id $transId"); } ), ``` -------------------------------- ### Initialize Tencent Ad Stream and Callbacks Source: https://pub.dev/packages/flutter_tencentad/example Sets up the ad stream listeners for rewarded and interstitial ads, including bidding logic and event handling. ```dart _adViewStream = FlutterTencentAdStream.initAdStream( //激励广告 flutterTencentadRewardCallBack: FlutterTencentadRewardCallBack( onShow: () { print("激励广告显示"); }, onClick: () { print("激励广告点击"); }, onFail: (code, message) { print("激励广告失败 $code $message"); }, onClose: () { print("激励广告关闭"); }, onReady: () async { print("激励广告预加载准备就绪"); await FlutterTencentad.showRewardVideoAd(); }, onUnReady: () { print("激励广告预加载未准备就绪"); }, onVerify: (transId, rewardName, rewardAmount) { print("激励广告奖励 $transId $rewardName $rewardAmount"); }, onExpose: () { print("激励广告曝光"); }, onFinish: () { print("激励广告完成"); }, onECPM: (ecpmLevel, ecpm) async { print("激励广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer await FlutterTencentad.showRewardVideoAd( result: FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID await FlutterTencentad.showRewardVideoAd( result: FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }, ), flutterTencentadInteractionCallBack: FlutterTencentadInteractionCallBack( onShow: () { print("插屏广告显示"); }, onClick: () { print("插屏广告点击"); }, onFail: (code, message) { print("插屏广告失败 $code $message"); }, onClose: () { print("插屏广告关闭"); }, onExpose: () { print("插屏广告曝光"); }, onReady: () async { print("插屏广告预加载准备就绪"); await FlutterTencentad.showUnifiedInterstitialAD(); }, onUnReady: () { print("插屏广告预加载未准备就绪"); }, onVerify: (transId, rewardName, rewardAmount) { print("插屏广告奖励凭证id $transId"); }, onECPM: (ecpmLevel, ecpm) async { print("插屏广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer await FlutterTencentad.showUnifiedInterstitialAD( result: FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID await FlutterTencentad.showUnifiedInterstitialAD( result: FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }, ), ); ``` -------------------------------- ### Initialize Tencent Ad SDK Source: https://pub.dev/packages/flutter_tencentad/example Registers the SDK with required IDs and privacy settings. Call this during app initialization to ensure compliance and proper configuration. ```dart Future _register() async { _isRegister = await FlutterTencentad.register( //androidId androidId: AppId.androidId, //iosId iosId: AppId.iosId, //是否显示日志log debug: true, //是否显示个性化推荐广告 personalized: FlutterTencentadPersonalized.show, //渠道id channelId: FlutterTencentadChannel.other, enableCollectAppInstallStatus: false, //安卓隐私合规 是否开启收集应用安装状态 //安卓隐私设置 androidPrivacy: { //false为关闭粗略地理位置获取,不设置或者设置为true为获取 "cell_id": false, //优量汇SDK将不采集mac地址 "mac_address": false, //false为关闭device_id获取,不设置或者设置为true为获取 "device_id": false, //false为关闭android_id获取,不设置或者设置为true为获取 "android_id": false, //false为关闭移动网络状态下获取IP地址,不设置或者设置为true为获取 "mipaddr": false, //false为关闭WIFI状态下获取IP地址,不设置或者设置为true为获取 "wipaddr": false, //禁用taid获取 "taid": false, //禁用oaid获取 "oaid": false }, convOptimizelnfo: { //关闭应用安装监听状态 "hieib": false }); _sdkVersion = await FlutterTencentad.getSDKVersion(); setState(() {}); } ``` -------------------------------- ### Configure iOS Info.plist Source: https://pub.dev/packages/flutter_tencentad Enable PlatformView support by adding the required key to the Info.plist file. ```xml io.flutter.embedded_views_preview ``` -------------------------------- ### FlutterTencentad.register Source: https://pub.dev/packages/flutter_tencentad Initializes the Tencent Ad SDK with required platform IDs and privacy settings. ```APIDOC ## FlutterTencentad.register ### Description Initializes the Tencent Ad SDK. This must be called before any other ad-related operations. ### Parameters - **androidId** (String) - Required - The Android application ID. - **iosId** (String) - Required - The iOS application ID. - **debug** (bool) - Optional - Whether to show debug logs. - **personalized** (FlutterTencentadPersonalized) - Optional - Configuration for personalized recommendations. - **channelId** (FlutterTencentadChannel) - Optional - The channel ID. - **androidPrivacy** (Map) - Optional - Privacy settings for Android compliance. - **convOptimizelnfo** (Map) - Optional - Conversion optimization settings. - **enableCollectAppInstallStatus** (bool) - Optional - Whether to collect app installation status. ``` -------------------------------- ### Open App Download List Source: https://pub.dev/packages/flutter_tencentad/example Opens the native app download list page. ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('app下载列表'), onPressed: () async { await FlutterTencentad.enterAPPDownloadListPage(); }, ), ``` -------------------------------- ### FlutterTencentad.loadRewardVideoAd Source: https://pub.dev/packages/flutter_tencentad Preloads a rewarded video ad. ```APIDOC ## FlutterTencentad.loadRewardVideoAd ### Description Preloads a rewarded video ad for later display. ### Parameters - **androidId** (String) - Required - Android ad unit ID - **iosId** (String) - Required - iOS ad unit ID - **userID** (String) - Optional - User identifier - **rewardName** (String) - Optional - Name of the reward - **rewardAmount** (int) - Optional - Amount of the reward - **customData** (String) - Optional - Custom data for server-side callback - **downloadConfirm** (bool) - Optional - Whether to show download confirmation dialog - **isBidding** (bool) - Optional - Whether to enable bidding mode ``` -------------------------------- ### Configure Android Permissions Source: https://pub.dev/packages/flutter_tencentad Add necessary permissions and application tags to the AndroidManifest.xml file. ```xml ``` -------------------------------- ### Implement Splash Ad Source: https://pub.dev/packages/flutter_tencentad Displays a splash ad with support for bidding callbacks. The fetchDelay parameter controls the maximum time allowed for ad loading. ```dart FlutterTencentAdBiddingController _bidding = new FlutterTencentAdBiddingController(); FlutterTencentad.splashAdView( //android广告id androidId: widget.androidId, //ios广告id iosId: widget.iosId, ////设置开屏广告从请求到展示所花的最大时长(并不是指广告曝光时长),取值范围为[1500, 5000]ms fetchDelay: 3000, //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价 默认不开启 isBidding: widget.isBidding, //竞价结果回传 bidding: _bidding, //广告回调 callBack: FlutterTencentadSplashCallBack(onShow: () { print("开屏广告显示"); }, onADTick: (time) { print("开屏广告倒计时剩余时间 $time"); }, onClick: () { print("开屏广告点击"); }, onClose: () { print("开屏广告关闭"); Navigator.pop(context); }, onExpose: () { print("开屏广告曝光"); }, onFail: (code, message) { print("开屏广告失败 $code $message"); Navigator.pop(context); }, onECPM: (ecpmLevel, ecpm) { print("开屏广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer _bidding.biddingResult( FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID _bidding.biddingResult(FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }), ), ``` -------------------------------- ### enterAPPDownloadListPage Source: https://pub.dev/packages/flutter_tencentad Navigates to the app download list page (Android only). ```APIDOC ## enterAPPDownloadListPage ### Description Opens the application download list page. This method is only supported on Android. ``` -------------------------------- ### FlutterTencentad.showRewardVideoAd Source: https://pub.dev/packages/flutter_tencentad Displays the preloaded rewarded video ad. ```APIDOC ## FlutterTencentad.showRewardVideoAd ### Description Displays the rewarded video ad. Can be called with an optional bidding result. ### Parameters - **result** (FlutterTencentBiddingResult) - Optional - Bidding result object ``` -------------------------------- ### initAdStream Source: https://pub.dev/packages/flutter_tencentad Initializes the ad stream listener to handle ad lifecycle events and bidding callbacks. ```APIDOC ## initAdStream ### Description Registers callbacks for ad events including show, click, fail, close, ready, unready, verify, and ECPM bidding events. ``` -------------------------------- ### Implement Dynamic Information Flow/Banner/Video Patch Ads Source: https://pub.dev/packages/flutter_tencentad Use expressAdView to display dynamic ads with optional bidding support. Ensure the bidding controller is initialized if isBidding is set to true. ```dart FlutterTencentAdBiddingController _bidding = new FlutterTencentAdBiddingController(); FlutterTencentad.expressAdView( //android广告id androidId: "4033498034524284", //ios广告id iosId: "4033278955532222", viewWidth: 400, viewHeight: 300, //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价模式 isBidding: true, bidding: _bidding, //回调事件 callBack: FlutterTencentAdExpressCallBack( onShow: () { print("动态信息流广告显示"); }, onFail: (code, message) { print("动态信息流广告错误 $code $message"); }, onClose: () { print("动态信息流广告关闭"); }, onExpose: () { print("动态信息流广告曝光"); }, onClick: () { print("动态信息流广告点击"); }, onECPM: (ecpmLevel, ecpm) { print("动态信息流广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer _bidding.biddingResult( FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID _bidding.biddingResult(FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } } ), ), ``` -------------------------------- ### Retrieve SDK Version Source: https://pub.dev/packages/flutter_tencentad Fetches the current version of the integrated Tencent Ad SDK. ```dart await FlutterTencentad.getSDKVersion(); ``` -------------------------------- ### FlutterTencentad.getSDKVersion Source: https://pub.dev/packages/flutter_tencentad Retrieves the current version of the Tencent Ad SDK. ```APIDOC ## FlutterTencentad.getSDKVersion ### Description Returns the version string of the currently integrated Tencent Ad SDK. ``` -------------------------------- ### Registering FlutterTencentad Source: https://pub.dev/packages/flutter_tencentad/changelog Configuration parameters for registering the plugin, including channel ID and personalized ad settings. ```dart channelId 渠道id [FlutterTencentadChannel] personalized 是否开启个性化广告 [FlutterTencentadPersonalized] ``` -------------------------------- ### Manage Rewarded Video Ads Source: https://pub.dev/packages/flutter_tencentad Methods for preloading, displaying, and listening to rewarded video ad events. Bidding logic should be handled within the onECPM callback. ```dart await FlutterTencentad.loadRewardVideoAd( //android广告id androidId: "5042816813706194", //ios广告id iosId: "8062535056034159", //用户id userID: "123", //奖励 rewardName: "100金币", //奖励数 rewardAmount: 100, //扩展参数 服务器回调使用 customData: "" //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价 isBidding: true, ); ``` ```dart await FlutterTencentad.showRewardVideoAd(); ``` ```dart FlutterTencentAdStream.initAdStream( //激励广告 flutterTencentadRewardCallBack: FlutterTencentadRewardCallBack( onShow: () { print("激励广告显示"); }, onClick: () { print("激励广告点击"); }, onFail: (code, message) { print("激励广告失败 $code $message"); }, onClose: () { print("激励广告关闭"); }, onReady: () async { print("激励广告预加载准备就绪"); await FlutterTencentad.showRewardVideoAd(); }, onUnReady: () { print("激励广告预加载未准备就绪"); }, onVerify: (transId,rewardName,rewardAmount) { print("激励广告奖励 $transId $rewardName $rewardAmount"); }, onFinish: (){ print("激励广告完成"); }, onECPM: (ecpmLevel, ecpm) async { print("激励广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer await FlutterTencentad.showRewardVideoAd( result: FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID await FlutterTencentad.showRewardVideoAd( result: FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }, ), ); ``` -------------------------------- ### Check Flutter Development Environment Source: https://pub.dev/packages/flutter_tencentad Verify the local development environment configuration using the flutter doctor command. ```text [✓] Flutter (Channel stable, 3.16.6, on macOS 14.2.1 23C71 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.1) [✓] Android Studio (version 2023.1) [✓] IntelliJ IDEA Ultimate Edition (version 2023.3.2) [✓] VS Code (version 1.85.2) [✓] Connected device (4 available) [✓] Network resources ``` -------------------------------- ### Initialize Interstitial Ad Stream Listener Source: https://pub.dev/packages/flutter_tencentad Registers callbacks for ad lifecycle events including show, click, failure, close, and bidding results. Use onReady to trigger display or onECPM to handle bidding logic. ```dart FlutterTencentAdStream.initAdStream( flutterTencentadInteractionCallBack: FlutterTencentadInteractionCallBack( onShow: () { print("插屏广告显示"); }, onClick: () { print("插屏广告点击"); }, onFail: (code, message) { print("插屏广告失败 $code $message"); }, onClose: () { print("插屏广告关闭"); }, onReady: () async { print("插屏广告预加载准备就绪"); await FlutterTencentad.showUnifiedInterstitialAD(); }, onUnReady: () { print("插屏广告预加载未准备就绪"); }, onVerify: (transId,rewardName,rewardAmount){ print("广告奖励凭证id $transId"); }, onECPM: (ecpmLevel, ecpm) async { print("插屏广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer await FlutterTencentad.showUnifiedInterstitialAD( result: FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID await FlutterTencentad.showUnifiedInterstitialAD( result: FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }, ), ); ``` -------------------------------- ### Navigate to Splash Ad Page Source: https://pub.dev/packages/flutter_tencentad/example Navigates to a splash ad page, with options for standard or bidding configurations. ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('开屏广告'), onPressed: () async { Navigator.push(context, MaterialPageRoute(builder: (_) { return new SplashPage( isBidding: false, androidId: SplashAdId.androidId, iosId: SplashAdId.iosId); })); }, ), ``` ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('开屏广告(竞价)'), onPressed: () async { Navigator.push(context, MaterialPageRoute(builder: (_) { return new SplashPage( //是否开启竞价 isBidding: true, androidId: SplashAdId.androidId, iosId: SplashAdId.iosId); })); }, ), ``` -------------------------------- ### Navigate to Banner Ad Page Source: https://pub.dev/packages/flutter_tencentad/example Navigates to a page displaying a platform template banner ad. ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('Banner广告(平台模板)'), onPressed: () async { Navigator.push(context, MaterialPageRoute(builder: (_) { return new BannerPage(); })); }, ), ``` -------------------------------- ### Import Plugin in Dart Source: https://pub.dev/packages/flutter_tencentad Import the package into your Dart files to access the plugin functionality. ```dart import 'package:flutter_tencentad/flutter_tencentad.dart'; ``` -------------------------------- ### FlutterTencentAdStream.initAdStream Source: https://pub.dev/packages/flutter_tencentad Initializes the stream listener for rewarded video ad events. ```APIDOC ## FlutterTencentAdStream.initAdStream ### Description Sets up listeners for rewarded video ad lifecycle events including show, click, fail, close, ready, verify, and bidding callbacks. ### Parameters - **flutterTencentadRewardCallBack** (FlutterTencentadRewardCallBack) - Required - Callback object for ad events ``` -------------------------------- ### showUnifiedInterstitialAD Source: https://pub.dev/packages/flutter_tencentad Displays the preloaded interstitial ad. ```APIDOC ## showUnifiedInterstitialAD ### Description Displays the previously loaded interstitial ad. Optionally accepts a bidding result object. ``` -------------------------------- ### Implement Banner Ad Source: https://pub.dev/packages/flutter_tencentad Displays a banner ad with specified dimensions and bidding logic. Ensure the aspect ratio is maintained at 6.4:1. ```dart FlutterTencentAdBiddingController _bidding = new FlutterTencentAdBiddingController(); FlutterTencentad.bannerAdView( //android广告id androidId: "8042711873318113", //ios广告id iosId: "6062430096832369", //广告宽 单位dp viewWidth: 500, //广告高 单位dp 宽高比应该为6.4:1 viewHeight: 100, //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价 默认不开启 isBidding: widget.isBidding, //竞价结果回传 bidding: _bidding, // 广告回调 callBack: FlutterTencentadBannerCallBack( onShow: () { print("Banner广告显示"); }, onFail: (code, message) { print("Banner广告错误 $code $message"); }, onClose: () { print("Banner广告关闭"); }, onExpose: () { print("Banner广告曝光"); }, onClick: () { print("Banner广告点击"); }, onECPM: (ecpmLevel, ecpm) { print("Banner广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm"); //规则 自己根据业务处理 if (ecpm > 0) { //竞胜出价,类型为Integer //最大竞败方出价,类型为Integer _bidding.biddingResult( FlutterTencentBiddingResult().success(ecpm, 0)); } else { //竞胜方出价(单位:分),类型为Integer //优量汇广告竞败原因 FlutterTencentAdBiddingLossReason //竞胜方渠道ID FlutterTencentAdADNID _bidding.biddingResult(FlutterTencentBiddingResult().fail( 1000, FlutterTencentAdBiddingLossReason.LOW_PRICE, FlutterTencentAdADNID.othoerADN)); } }, ), ), ``` -------------------------------- ### loadUnifiedInterstitialAD Source: https://pub.dev/packages/flutter_tencentad Preloads a unified interstitial ad with specified configuration parameters. ```APIDOC ## loadUnifiedInterstitialAD ### Description Preloads a unified interstitial ad for display. ### Parameters - **androidId** (String) - Required - Android ad unit ID - **iosId** (String) - Required - iOS ad unit ID - **isFullScreen** (bool) - Optional - Whether the ad is full screen - **downloadConfirm** (bool) - Optional - Whether to show download confirmation dialog - **isBidding** (bool) - Optional - Whether to enable bidding ``` -------------------------------- ### Insecure Link in README Source: https://pub.dev/packages/flutter_tencentad/score Identifies an insecure HTTP link in the README.md file that should be updated to HTTPS. ```markdown ╷ 10 │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ``` -------------------------------- ### Navigate to Express Ad Page Source: https://pub.dev/packages/flutter_tencentad/example Navigates to a page for dynamic information flow, banner, or video patch ads. ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('动态信息流/横幅/视频贴片广告'), onPressed: () async { Navigator.push(context, MaterialPageRoute(builder: (_) { return new ExpressPage(); })); }, ), ``` -------------------------------- ### FlutterTencentad.expressAdView Source: https://pub.dev/packages/flutter_tencentad Displays a dynamic information flow, banner, or video patch ad. ```APIDOC ## FlutterTencentad.expressAdView ### Description Displays a dynamic express ad view with support for bidding and event callbacks. ### Parameters - **androidId** (String) - Required - Android ad unit ID - **iosId** (String) - Required - iOS ad unit ID - **viewWidth** (int) - Required - Width of the ad view - **viewHeight** (int) - Required - Height of the ad view - **downloadConfirm** (bool) - Optional - Whether to show download confirmation dialog - **isBidding** (bool) - Optional - Whether to enable bidding mode - **bidding** (FlutterTencentAdBiddingController) - Optional - Bidding controller instance - **callBack** (FlutterTencentadExpressCallBack) - Optional - Ad event callbacks ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://pub.dev/packages/flutter_tencentad Include the latest version of the flutter_tencentad package in your project configuration. ```yaml flutter_tencentad: ^latest ``` -------------------------------- ### Load Unified Interstitial Ads Source: https://pub.dev/packages/flutter_tencentad/example Loads interstitial ads with support for half-screen, full-screen, and rewarded interstitial configurations. ```dart await FlutterTencentad.loadUnifiedInterstitialAD( //android广告id androidId: InterstitialAdId.androidId, //ios广告id iosId: InterstitialAdId.iosId, //是否全屏 isFullScreen: false, //下载二次确认弹窗 默认false downloadConfirm: true, ); ``` ```dart await FlutterTencentad.loadUnifiedInterstitialAD( //android广告id androidId: InterstitialAdId.androidId, //ios广告id iosId: InterstitialAdId.iosId, isFullScreen: true, //下载二次确认弹窗 默认false downloadConfirm: true, ); ``` ```dart await FlutterTencentad.loadUnifiedInterstitialAD( //android广告id androidId: InterstitialAdId.androidId, //ios广告id iosId: InterstitialAdId.iosId, isFullScreen: true, ``` -------------------------------- ### FlutterTencentad.splashAdView Source: https://pub.dev/packages/flutter_tencentad Displays a splash ad view with support for bidding and event callbacks. ```APIDOC ## FlutterTencentad.splashAdView ### Description Displays a splash ad. Includes configuration for bidding and various lifecycle callbacks. ### Parameters - **androidId** (String) - Required - Android ad unit ID. - **iosId** (String) - Required - iOS ad unit ID. - **fetchDelay** (int) - Optional - Max duration for ad request in ms. - **downloadConfirm** (bool) - Optional - Whether to show download confirmation. - **isBidding** (bool) - Optional - Whether to enable bidding. - **bidding** (FlutterTencentAdBiddingController) - Optional - Controller for bidding results. - **callBack** (FlutterTencentadSplashCallBack) - Optional - Event callbacks for ad lifecycle. ``` -------------------------------- ### Load Interstitial Ad Source: https://pub.dev/packages/flutter_tencentad/example Loads a half-screen interstitial ad with bidding enabled. ```dart MaterialButton( color: Colors.blue, textColor: Colors.white, child: new Text('插屏广告(半屏竞价)'), onPressed: () async { await FlutterTencentad.loadUnifiedInterstitialAD( //android广告id androidId: AppId.androidId, //ios广告id iosId: AppId.iosId, isFullScreen: false, //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价 isBidding: true, ); }, ), ``` -------------------------------- ### Load Rewarded Video Ads Source: https://pub.dev/packages/flutter_tencentad/example Loads rewarded video ads with options for standard playback or bidding configurations. ```dart await FlutterTencentad.loadRewardVideoAd( //android广告id androidId: RewardAdId.androidId, //ios广告id iosId: RewardAdId.iosId, //用户id userID: "123", //奖励 rewardName: "100金币", //奖励数 rewardAmount: 100, //扩展参数 服务器回调使用 customData: "", //下载二次确认弹窗 默认false downloadConfirm: true, //是否静音播放 默认false videoMuted: true, ); ``` ```dart await FlutterTencentad.loadRewardVideoAd( //android广告id androidId: InterstitialAdId.androidId, //ios广告id iosId: InterstitialAdId.iosId, //用户id userID: "123", //奖励 rewardName: "100金币", //奖励数 rewardAmount: 100, //扩展参数 服务器回调使用 customData: "", //下载二次确认弹窗 默认false downloadConfirm: true, //开启竞价 isBidding: true); ``` -------------------------------- ### Dangling Library Doc Comment Source: https://pub.dev/packages/flutter_tencentad/score Static analysis warning for a malformed or misplaced library documentation comment. ```dart ╷ 4 │ /// @time 2020/3/11 │ ^^^^^^^^^^^^^^^^^^^^^ ╵ ``` -------------------------------- ### Missing Type Annotation Source: https://pub.dev/packages/flutter_tencentad/score Static analysis warning regarding a missing type annotation in the bidding controller. ```dart ╷ 11 │ init(MethodChannel? method) { │ ^^^^ ╵ ``` -------------------------------- ### FlutterTencentad.bannerAdView Source: https://pub.dev/packages/flutter_tencentad Displays a banner ad view with specified dimensions and bidding support. ```APIDOC ## FlutterTencentad.bannerAdView ### Description Displays a banner ad at a specific size. Supports bidding and event callbacks. ### Parameters - **androidId** (String) - Required - Android ad unit ID. - **iosId** (String) - Required - iOS ad unit ID. - **viewWidth** (double) - Required - Width of the ad view. - **viewHeight** (double) - Required - Height of the ad view. - **downloadConfirm** (bool) - Optional - Whether to show download confirmation. - **isBidding** (bool) - Optional - Whether to enable bidding. - **bidding** (FlutterTencentAdBiddingController) - Optional - Controller for bidding results. - **callBack** (FlutterTencentadBannerCallBack) - Optional - Event callbacks for ad lifecycle. ``` -------------------------------- ### Show Interstitial Ad Source: https://pub.dev/packages/flutter_tencentad Displays a previously loaded interstitial ad. ```dart await FlutterTencentad.showUnifiedInterstitialAD(); ``` -------------------------------- ### Preload Interstitial Ad Source: https://pub.dev/packages/flutter_tencentad Preloads an interstitial ad using specific Android and iOS IDs. Configure full-screen mode, download confirmation, and bidding status via parameters. ```dart await FlutterTencentad.loadUnifiedInterstitialAD( //android广告id androidId: "9062813863614416", //ios广告id iosId: "1052938046031440", //是否全屏 isFullScreen: false, //下载二次确认弹窗 默认false downloadConfirm: true, //是否开启竞价 isBidding: true, ); ``` -------------------------------- ### Dispose Ad Stream Source: https://pub.dev/packages/flutter_tencentad/example Cancels the ad view stream when the widget is disposed. ```dart @override void dispose() { _adViewStream?.cancel(); super.dispose(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.