بازرس آگهی را راه اندازی کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پلتفرم را انتخاب کنید: Android iOS Unity Flutter قبل از اینکه یکپارچه سازی تبلیغات خود را آزمایش کنید، باید بازرس آگهی را در برنامه خود راه اندازی کنید. این صفحه نحوه راهاندازی بازرس آگهی از طریق منوی اشکالزدایی و نحوه راهاندازی برنامهریزی را پوشش میدهد.
پیش نیازها
قبل از ادامه، موارد زیر را انجام دهید:
- تمام موارد موجود در پیش نیازهای اولیه را تکمیل کنید تا یک حساب Ad Manager ایجاد کنید، دستگاه آزمایشی خود را تنظیم کنید، SDK تبلیغات تلفن همراه Google را مقداردهی اولیه کنید و آخرین نسخه را نصب کنید.
یک گزینه راه اندازی را انتخاب کنید
شما می توانید ad inspector را به روش های زیر راه اندازی کنید:
- دکمه راه اندازی از منوی اشکال زدایی در برنامه شما برای استفاده از حرکتی که در تنظیمات بازرس آگهی انتخاب کرده اید.
- به صورت برنامه نویسی از طریق Google Mobile Ads SDK.
برای راهاندازی Ad Inspector از طریق منوی اشکالزدایی، نیازی به تغییرات بیشتری در برنامه خود ندارید. برای جزئیات بیشتر، به بررسی تحویل تبلیغات برنامه تلفن همراه مراجعه کنید.
مراحل زیر را کامل کنید:
- آگهی ارائه شده در شبکه Ad Manager خود را پیدا کنید.
- برای باز کردن منوی اشکال زدایی، تبلیغ را لمس کرده و نگه دارید.
- بازرس آگهی باز را انتخاب کنید.
اگر دستگاه خود را پیوند نداده اید، ممکن است لازم باشد به حساب Ad Manager خود وارد شوید.
از تنظیمات اشکال زدایی، همچنین می توانید تنظیمات بازرس آگهی را انتخاب کنید و حرکتی را انتخاب کنید که بتواند بازرس آگهی را باز کند.
به صورت برنامه ای راه اندازی کنید
بازرس آگهی را با اجرای موارد زیر راه اندازی کنید:
سویفت
MobileAds.shared.presentAdInspector(from: viewController) { error in
// Error will be non-nil if there was an issue and the inspector was not displayed.
}
هدف-C
[GADMobileAds.sharedInstance presentAdInspectorFromViewController:viewController
completionHandler:^(NSError *error) {
// Error will be non-nil if there was an issue and the inspector was not displayed.
}];
این روش برای دستگاه های آزمایشی که به صورت برنامه نویسی ثبت شده اند کار می کند. برای جزئیات بیشتر، به فعال کردن دستگاههای آزمایشی مراجعه کنید.
اطمینان حاصل کنید که کنترلر نمای این راه اندازی به طور کامل روی صفحه قابل مشاهده است. برای مثال، اگر viewDidAppear:
. اگر نمای کنترلکننده در حال نمایش باشد، مانند زمانی که راهاندازی در عملکرد کنترلکننده view viewDidLoad
فراخوانی میشود، نمایش بازرس آگهی با شکست مواجه میشود.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-09-02 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-09-02 بهوقت ساعت هماهنگ جهانی."],[],[],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/ad-inspector/launch-ad-inspector \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/ad-inspector/launch-ad-inspector \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/ad-inspector/launch-ad-inspector \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/ad-inspector/launch-ad-inspector \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nBefore you test your ad integration, you must launch ad inspector in your app.\nThis page covers how to launch ad inspector\nthrough the debug menu and how to launch\nprogrammatically.\n\nPrerequisites\n\nBefore you continue, do the following:\n\n- Complete all items in the initial [Prerequisites](/ad-manager/mobile-ads-sdk/ios/ad-inspector#prerequisites) to create an Ad Manager account, set your test device, initialize Google Mobile Ads SDK, and install the latest version.\n\nChoose a launch option\n\nYou can launch ad inspector in the following ways:\n\n- The launch button from the debug menu within your app to use the gesture that you selected in the ad inspector settings.\n- Programmatically through the Google Mobile Ads SDK.\n\nLaunch using the debug menu\n\nTo launch ad inspector through the debug menu, you don't require further\nchanges on your app. For more details, see\n[Inspect mobile app ad delivery](//support.google.com/admanager/answer/7180401).\n\nComplete the following steps:\n\n1. Find an ad served in your Ad Manager network.\n2. Touch and hold the ad to open the debug menu.\n3. Select **Open ad inspector**.\n\nIf you didn't [link your device](/ad-manager/mobile-ads-sdk/ios/debug#link_your_device), you might\nneed to sign in to your Ad Manager account.\n\nFrom the debug settings, you can also select **Ad inspector settings** and\nchoose a gesture that can open ad inspector.\n\nLaunch programmatically\n\nLaunch ad inspector by running the following: \n\nSwift \n\n MobileAds.shared.presentAdInspector(from: viewController) { error in\n // Error will be non-nil if there was an issue and the inspector was not displayed.\n }\n\nObjective-C \n\n [GADMobileAds.sharedInstance presentAdInspectorFromViewController:viewController\n completionHandler:^(NSError *error) {\n // Error will be non-nil if there was an issue and the inspector was not displayed.\n }];\n\nThis method works for test devices registered programmatically. For more details, see\n[Enable test devices](/ad-manager/mobile-ads-sdk/ios/test-ads#enable_test_devices).\n\nEnsure that the view controller to this launch is fully visible on screen. For\nexample, if you called `viewDidAppear:`. If the view controller passed in is\nin the process to display, such as when the launch is called in the view\ncontroller function `viewDidLoad`, the presentation of the ad inspector fails."]]