Uruchom inspektora reklam
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wybierz platformę:
Android
iOS
Unity
Flutter
Zanim przetestujesz integrację reklam, musisz uruchomić inspektora reklam w aplikacji.
Na tej stronie znajdziesz informacje o tym, jak uruchomić inspektora reklam
za pomocą gestów
i programowo.
Wymagania wstępne
Zanim przejdziesz dalej:
- Aby utworzyć konto AdMob, skonfigurować urządzenie testowe, zainicjować pakiet SDK do reklam mobilnych Google i zainstalować najnowszą wersję, wykonaj wszystkie czynności opisane w sekcji Wymagania wstępne.
Wybieranie opcji uruchomienia
Inspektora reklam możesz uruchomić na te sposoby:
- Użyj gestu wybranego w interfejsie AdMob po zarejestrowaniu urządzenia testowego. Więcej informacji znajdziesz w artykule Konfigurowanie urządzenia testowego.
- programowo za pomocą pakietu SDK do reklam mobilnych Google.
Uruchamianie za pomocą gestów
Aby uruchomić inspektora reklam za pomocą gestu, wykonaj gest (np. dwukrotne szybkie poruszenie lub potrząśnięcie), który został skonfigurowany w interfejsie AdMob na urządzeniu testowym. Więcej informacji znajdziesz w artykule Testowanie aplikacji za pomocą inspektora reklam.
Po ustawieniu gestu w interfejsie AdMob poczekaj, aż zmiany zostaną wprowadzone. Wyślij żądanie reklamy za pomocą pakietu SDK do reklam mobilnych Google, aby zarejestrować ustawienie gestu na urządzeniu testowym. Jeśli wykonanie gestu nie spowoduje otwarcia inspektora reklam, spróbuj wczytać reklamę, ponownie uruchomić aplikację i ponownie przetestować gest.
Uruchamianie automatyczne
Uruchom inspektora reklam, wykonując te czynności:
Swift
MobileAds.shared.presentAdInspector(from: viewController) { error in
// Error will be non-nil if there was an issue and the inspector was not displayed.
}
Objective-C
[GADMobileAds.sharedInstance presentAdInspectorFromViewController:viewController
completionHandler:^(NSError *error) {
// Error will be non-nil if there was an issue and the inspector was not displayed.
}];
Ta metoda działa w przypadku urządzeń testowych zarejestrowanych programowo lub w interfejsie AdMob.
Więcej informacji znajdziesz w artykule Włączanie urządzeń testowych.
Upewnij się, że kontroler widoku jest w pełni widoczny na ekranie. Jeśli na przykład zadzwonisz pod numer viewDidAppear:
. Jeśli przekazany kontroler widoku jest w trakcie wyświetlania, np. gdy wywołanie następuje w funkcji kontrolera widoku viewDidLoad
, wyświetlenie inspektora reklam nie powiedzie się.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-09-05 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-09-05 UTC."],[],[],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."]]