بازرس آگهی را راه اندازی کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پلتفرم را انتخاب کنید: Android iOS Unity Flutter قبل از اینکه یکپارچه سازی تبلیغات خود را آزمایش کنید، باید بازرس آگهی را در برنامه خود راه اندازی کنید. این صفحه نحوه راهاندازی بازرس آگهی با استفاده از ژستها و نحوه راهاندازی برنامهای را پوشش میدهد.
پیش نیازها
قبل از ادامه، موارد زیر را انجام دهید:
- همه موارد موجود در پیش نیازهای اولیه را تکمیل کنید تا یک حساب AdMob ایجاد کنید، دستگاه آزمایشی خود را تنظیم کنید، SDK تبلیغات تلفن همراه Google را مقداردهی اولیه کنید و آخرین نسخه را نصب کنید.
یک گزینه راه اندازی را انتخاب کنید
شما می توانید ad inspector را به روش های زیر راه اندازی کنید:
- پس از ثبت دستگاه آزمایشی، از اشاره ای که در رابط کاربری AdMob انتخاب کرده اید استفاده کنید. برای جزئیات، به تنظیم یک دستگاه آزمایشی مراجعه کنید.
- به صورت برنامه نویسی از طریق Google Mobile Ads SDK.
با استفاده از ژستها راهاندازی کنید
برای راهاندازی بازرس آگهی با اشاره، حرکتی را که در رابط کاربری AdMob برای دستگاه آزمایشی خود پیکربندی کردهاید، انجام دهید. برای جزئیات بیشتر، به آزمایش برنامه خود با بازرس آگهی مراجعه کنید.
پس از تنظیم یک اشاره در رابط کاربری AdMob، زمان انتشار را در نظر بگیرید. از طریق Google Mobile Ads SDK درخواست تبلیغ کنید تا تنظیمات ژست خود را با دستگاه آزمایشی خود ثبت کنید. اگر انجام ژست شما در بازرس آگهی باز نشد، سعی کنید آگهی را بارگیری کنید، برنامه خود را مجددا راه اندازی کنید و ژست را دوباره آزمایش کنید.
راه اندازی برنامه ای
بازرس آگهی را با اجرای موارد زیر راه اندازی کنید:
سویفت
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.
}];
این روش برای دستگاه های آزمایشی که به صورت برنامه ریزی شده یا در رابط کاربری AdMob ثبت شده اند، کار می کند. برای جزئیات بیشتر، به فعال کردن دستگاههای آزمایشی مراجعه کنید.
اطمینان حاصل کنید که کنترلر نمای این راه اندازی به طور کامل روی صفحه قابل مشاهده است. برای مثال، اگر 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](/admob/android/ad-inspector/launch-ad-inspector \"View this page for the Android platform docs.\") [iOS](/admob/ios/ad-inspector/launch-ad-inspector \"View this page for the iOS platform docs.\") [Unity](/admob/unity/ad-inspector/launch-ad-inspector \"View this page for the Unity platform docs.\") [Flutter](/admob/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\nusing gestures\nand how to launch\nprogrammatically.\n\nPrerequisites\n\nBefore you continue, do the following:\n\n- Complete all items in the initial [Prerequisites](/admob/ios/ad-inspector#prerequisites) to create an AdMob 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- Use the gesture you selected in the AdMob UI after registering a test device. For details, see [Set up a test device](https://support.google.com/admob/answer/9691433).\n- Programmatically through the Google Mobile Ads SDK.\n\nLaunch using gestures\n\nTo launch ad inspector with a gesture, perform the gesture, such as a double\nflick or shake, that you configured in AdMob UI for your test\ndevice. For more details, see\n[Test your app with ad inspector](https://support.google.com/admob/answer/10159602).\n\nAfter you set a gesture in the AdMob UI, allow time to propagate. Make an ad\nrequest through the Google Mobile Ads SDK to register your\ngesture setting with your test device. If performing your gesture fails to\nopen in ad inspector, try to load an ad, restart your app, and test the gesture\nagain.\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\nprogrammatically or in the AdMob UI.\nFor more details, see\n[Enable test devices](/admob/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."]]