firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

[firebase_admob] Request Error: The Google ad request was unable to be fulfilled before a timeout occurred #2911

Closed xiaocairush closed 3 years ago

xiaocairush commented 4 years ago

Describe the bug I'm testing rewarded ads and banner ads in ios simulator. It works fine when using testAdUnitId. However, after changed testAdUnitId to my real adUnitId, I have received error message for rewarded ads: Error: Error Domain=com.google.admob Code=5 "Request Error: The Google ad request was unable to be fulfilled before a timeout occurred." UserInfo={NSLocalizedDescription=Request Error: The Google ad request was unable to be fulfilled before a timeout occurred.} Latency: 60.029

Seems like ad request timeout after 60.029 seconds. Refered to the document about error code 5 still confused about why it happens and how to deal with the problem.

To Reproduce Steps to reproduce the behavior:

  1. changed testAdUnitId to real adUnitId
  2. send request and receive the error message.

Expected behavior The rewarded ad should be fulfilled instead of failed each time because 60 seconds is very long.

Additional context My network should be ok because banner ad is fulfilled at the same time. Using testDevices and I can see banner ad is in test mode.

Flutter doctor

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.14.6 18G103, locale
    zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2018.2.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
bparrishMines commented 4 years ago

Hi @xiaocairush

I don't think there is anything we can do at the plugin level to help. The plugin just makes calls to the iOS SDK. I believe you may need to try finding support from AdMob: https://support.google.com/admob/?hl=en#topic=7383088

I would make sure your adUnitId is supported by https://developers.google.com/admob/ios/rewarded-video

russellwheatley commented 3 years ago

The firebase_admob plugin will be deprecated in April 2021 in favor of Google Mobile Ads SDK for Flutter. Google Mobile Ads SDK for Flutter is a new Flutter plugin that supports more Ads formats than firebase_admob does. Google Mobile Ads SDK for Flutter currently supports loading and displaying banner, interstitial (full-screen), native ads, and rewarded video ads across AdMob and AdManager. It also supports displaying banner and native ads as Widgets as opposed to being overlayed over all app content. We're now recommending projects currently using firebase_admob migrate to Google Mobile Ads SDK for Flutter following the instructions outlined here. Issues with migrating or with using the new package should now be raised over on the Google Mobile Ads SDK for Flutter repository.